moodle-saml / auth

Moodle SAML Auth plugin
https://moodle.org/plugins/auth_saml
3 stars 21 forks source link

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

Open erazorbg opened 5 years ago

erazorbg commented 5 years ago

The saml_config.php file used to hold 3 properties: samllib, sp_source and dosinglelogout https://github.com/moodle-saml/auth/blob/581955da5fceb5b0d58ab45cefa99a7d84a51ef6/saml_config.php#L1

But in settings.php only samllib is saved into the new file in the Moodle data dir. https://github.com/moodle-saml/auth/blob/581955da5fceb5b0d58ab45cefa99a7d84a51ef6/settings.php#L43-L48

This leads to $samlparam->sp_source not being defined in index.php and that causes the error in the subject. https://github.com/moodle-saml/auth/blob/581955da5fceb5b0d58ab45cefa99a7d84a51ef6/index.php#L61

chriss-ama commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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

chriss-ama commented 5 years ago

Hi Paul,

In my implementation, I edited line 61 of index.php. This line looks to be looking for the sp_source attribute of the $samlparam object, but it seems that value is never set.

That value is supposed to correspond to the value of the SimpleSAMLphp SP source field of the module’s configuration page within Moodle. [cid:image001.png@01D57446.A690AE10]

I modified line 61 of index.php to hard-code that value. [cid:image002.png@01D57446.A690AE10]

Of course – I hope this little bit of info will help!

From: paul notifications@github.com Sent: Wednesday, September 25, 2019 9:45 AM To: moodle-saml/auth auth@noreply.github.com Cc: Chris Savage chriss@modelaircraft.org; Mention mention@noreply.github.com Subject: Re: [moodle-saml/auth] Moodle SAML module:Error with authentication source '': Unknown authentication source. (#20)

@chriss-amahttps://github.com/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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/moodle-saml/auth/issues/20?email_source=notifications&email_token=ANADB6IQ3HA5PH6YEKR2H2TQLNTODA5CNFSM4HYMTOA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7R6UWA#issuecomment-535030360, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANADB6L4HJ4P54AE5P6PIUDQLNTODANCNFSM4HYMTOAQ.

sophieqc commented 5 years ago

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

sophieqc commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

Hi Paul,

So sorry I missed this while I was away. It looks like you were able to get the information you were looking for – is there anything else I can help you with?

-Chris

From: paul notifications@github.com Sent: Thursday, October 3, 2019 7:58 AM To: moodle-saml/auth auth@noreply.github.com Cc: Chris Savage chriss@modelaircraft.org; Mention mention@noreply.github.com Subject: Re: [moodle-saml/auth] Moodle SAML module:Error with authentication source '': Unknown authentication source. (#20)

@pcuriehttps://github.com/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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/moodle-saml/auth/issues/20?email_source=notifications&email_token=ANADB6LEIVVOBBH4K2XAHG3QMXM43A5CNFSM4HYMTOA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAH6V6A#issuecomment-537914104, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANADB6OXLUFYYLSPXXY22M3QMXM43ANCNFSM4HYMTOAQ.