Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

467
Views
SimpleSamlPHP not resolving custom authentication module

I want to create a custom authentication module for my SimpleSamlPHP installation, but each time I try to test the module I get this error:

SimpleSAML\Error\Error: UNHANDLEDEXCEPTION

Backtrace:
1 www/_include.php:17 (SimpleSAML_exception_handler)
0 [builtin] (N/A)
Caused by: Exception: Could not resolve 'mymodule:MyAuth': no class named 'SimpleSAML\Module\mymodule\Auth\Source\MyAuth' or 'sspmod_mymodule_Auth_Source_MyAuth'.
Backtrace:
7 lib/SimpleSAML/Module.php:437 (SimpleSAML\Module::resolveClass)
6 lib/SimpleSAML/Auth/Source.php:336 (SimpleSAML\Auth\Source::parseAuthSource)
5 lib/SimpleSAML/Auth/Source.php:382 (SimpleSAML\Auth\Source::getById)
4 lib/SimpleSAML/Auth/Simple.php:66 (SimpleSAML\Auth\Simple::getAuthSource)
3 lib/SimpleSAML/Auth/Simple.php:166 (SimpleSAML\Auth\Simple::login)
2 modules/core/www/authenticate.php:38 (require)
1 lib/SimpleSAML/Module.php:254 (SimpleSAML\Module::process)
0 www/module.php:10 (N/A)

I have followed SimpleSAML's tutorial down to step four where I need to test the module. In my config.php file I am enabling the module like so:

'myauth' => [
    'mymodule:MyAuth'
],

If I change the module name in the config file to one of SimpleSaml's pre-installed modules eg.

'myauth' => [
    'sqlauth:MyAuth'
],

then it works just fine. In fact, if I change the name of my custom module folder to be the same as one of the pre-installed modules and change the namespace path in my module file to reflect that, my module code works just fine. I believe that it has something to do with the namespace in my module file, but I cannot figure it out. I am using SimpleSaml version 1.18.5 and php version 7.2.24 on Ubuntu 18.04.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I came across this issue myself; I spent hours on this issue...

To fix your issue; depending on your version of SimpleSAMLphp (as of the latest), the 'default_enable' or 'enable' file in the root of your module will not work. You have to enable your module manually, by adding the following to the config.php file:

<?php
$config = [
  module.enable = [
    'core' => null,
    'saml' => true,
    'customAuth' => true,
  ],
],

This will make your customAuth module work.

For some reason, psr4 autoloaded modules work out-of-the-box (the modules you install using composer etc.).

If you can, avoid simpleSAMLphp and go for something more serious.

over 4 years ago · Santiago Trujillo Report

0

Just ran into this myself. The documentation is unclear, but you need to add an "enable" file at the root of your module folder as suggested by Patrick in the comments. It can be a completely empty file just with the name "enable" and nothing in it. On the command line in a Linux/Unix system, you could do this:

touch enable
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!