Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moodle SAML module:Error with authentication source '': Unknown authentication source. #20

Open
erazorbg opened this issue Jun 14, 2019 · 9 comments

Comments

@erazorbg
Copy link
Contributor

erazorbg commented Jun 14, 2019

The saml_config.php file used to hold 3 properties: samllib, sp_source and dosinglelogout

{"samllib":"\/var\/www\/simplesamlphp\/lib","sp_source":"default-sp","dosinglelogout":"on"}

But in settings.php only samllib is saved into the new file in the Moodle data dir.

auth/settings.php

Lines 43 to 48 in 581955d

$pluginconfig = get_config('auth_saml');
$param['samllib'] = $pluginconfig->samllib;
// Save saml settings in a file.
$encodedparam = json_encode($param);
file_put_contents($samlconfigfile, $encodedparam);

This leads to $samlparam->sp_source not being defined in index.php and that causes the error in the subject.

auth/index.php

Line 61 in 581955d

$as = new SimpleSAML_Auth_Simple($samlparam->sp_source);

@chriss-ama
Copy link

I'm also experiencing this issue. While I'm not familiar enough yet with the plugin to diagnose it as erazorbg did, I found that hard-coding my sp_source in index.php resolved the issue, so it does appear as though that value isn't available.

@sophieqc
Copy link

@chriss-ama Hello,

I'm trying to bypass this bug like you did, would you mind sharing how you did it exactly ? I tried a few things into index.php without much success, the best I can get is "Error with authentication source '0': Unknown authentication source."

Thank you

@erazorbg
Copy link
Contributor Author

Checkout #24 for the fix I used, I hope it helps.

@chriss-ama
Copy link

chriss-ama commented Sep 26, 2019 via email

@sophieqc
Copy link

@chriss-ama thank you but your images didn't reach use, would you mind sharing a diff or the complete line ? thanks

@sophieqc
Copy link

@erazorbg thank you for your commit, but in my case that didn't solve the problem, moodle 3.5 & 3.7, after modifying the file to add the 2 lines, restart apache, the bug is still present. something else I need to do ?

@erazorbg
Copy link
Contributor Author

@pcurie The code is called when you save the settings. You might need to go to the plugin settings page and re-save the settings. This should re-create the saml_config.php file with the proper contents.

@sophieqc
Copy link

sophieqc commented Oct 3, 2019

@pcurie The code is called when you save the settings. You might need to go to the plugin settings page and re-save the settings. This should re-create the saml_config.php file with the proper contents.

That was it thank you

@chriss-ama
Copy link

chriss-ama commented Oct 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants