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

Test functionality not working in Moodle 3.6 #322

Closed
jtsafran opened this issue Apr 3, 2019 · 4 comments
Closed

Test functionality not working in Moodle 3.6 #322

jtsafran opened this issue Apr 3, 2019 · 4 comments
Labels

Comments

@jtsafran
Copy link

jtsafran commented Apr 3, 2019

When trying to use the test functionality from Manage Authentication, no IdPs show in the list to test. Using the direct link (https:///auth/saml2/test.php?login=true), we get the following error:

Exception - Could not find the metadata of an IdP with entity ID ''

Debug info:
Error code: generalexceptionmessage

×Stack trace:
line 135 of /auth/saml2/extlib/simplesamlphp/modules/saml/lib/Auth/Source/SP.php: SimpleSAML_Error_Exception thrown
line 328 of /auth/saml2/extlib/simplesamlphp/modules/saml/lib/Auth/Source/SP.php: call to sspmod_saml_Auth_Source_SP->getIdPMetadata()
line 431 of /auth/saml2/extlib/simplesamlphp/modules/saml/lib/Auth/Source/SP.php: call to sspmod_saml_Auth_Source_SP->startSSO()
line 193 of /auth/saml2/extlib/simplesamlphp/lib/SimpleSAML/Auth/Source.php: call to sspmod_saml_Auth_Source_SP->authenticate()
line 161 of /auth/saml2/extlib/simplesamlphp/lib/SimpleSAML/Auth/Simple.php: call to SimpleSAML_Auth_Source->initLogin()
line 103 of /auth/saml2/extlib/simplesamlphp/lib/SimpleSAML/Auth/Simple.php: call to SimpleSAML\Auth\Simple->login()
line 72 of /auth/saml2/test.php: call to SimpleSAML\Auth\Simple->requireAuth()

However, if you display the IdP button, the site will go to the SSO (ADFS in this case) without issue.

Not a total showstopper, but the testing is awesome for making sure you get the Attributes mapped correctly :-)

Thanks!
-Jesse

@leonstr
Copy link

leonstr commented Jun 28, 2019

I've added a pull request which fixes this for me (tested with Moodle 3.6 and 3.7). I've only tested with XML in auth_saml2 | idpmetadata not a metadata URL (I get "Invalid metadata" so I'm probably doing it wrong).

There were nested foreach loops in classes/form/testidpselect.php:definition() which didn't seem to match the structure of the arrays returned by locallib.php:auth_sam2_get_idps() so I've removed these and just passed entityid => name which appears to populate the IdP drop-down as expected. I don't know if I've just removed 10+ lines I shouldn't have just because I don't understand them and actually they were important.

@LoveBug
Copy link

LoveBug commented Aug 26, 2019

It looks like this issue also impacts version 3.5, Leons patch looks promising so I will be testing it shortly.

@LoveBug
Copy link

LoveBug commented Aug 27, 2019

I've tested Leons patch and it resolves the issue.
Additionally this bug also effects the 27-34 branch and any fix will need to be backported there as well.

@brendanheywood
Copy link
Contributor

Pretty sure this is already fixed

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

No branches or pull requests

4 participants