catalyst / moodle-auth_saml2

SAML done 100% in Moodle, fast, simple, secure
https://moodle.org/plugins/auth_saml2
73 stars 135 forks source link

Oops!, something went wrong ... from auth0 #632

Open leostereo opened 2 years ago

leostereo commented 2 years ago

Hi guys , I have been reading both auth0 and plugin documentation but can not succed on getting it working.

This is what I did (on moodle admin plugin settings): 1 I fill the IdP metadata xml OR public xml URL field Taken this url from from Auth0 app ->setting->advanced settings. ->SAML Metadata URL 2 Set the auto create user to yes. 3 set dual login to yes.

Then , on auth 0 settings , I had to set the Allowed Callback URLs" So I clicked on "View Service Provider Metadata" (from plugin settings view at moodle admin panel) and tryed with following urls:

<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://172.30.6.106:89/auth/saml2/sp/saml2-acs.php/172.30.6.106" index="0"/>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:1.0:profiles:browser-post" Location="http://172.30.6.106:89/auth/saml2/sp/saml1-acs.php/172.30.6.106" index="1"/>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact" Location="http://172.30.6.106:89/auth/saml2/sp/saml2-acs.php/172.30.6.106" index="2"/>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01" Location="http://172.30.6.106:89/auth/saml2/sp/saml1-acs.php/172.30.6.106" index="3"/>

Then , When trying to login , I got:

Oops!, something went wrong

And , looking at auth0 logs , I can see:

 "The SAML Request AssertionConsumerServiceURL is invalid: 'https://172.30.6.106/auth/saml2/sp/saml2-acs.php/172.30.6.106'",

Can you point what is the callback url I need to set on auth0? Is there another thing im forgetting to set? Can you point some working flow example for integrating with auth0 ? Thanks!!

brendanheywood commented 2 years ago

A quick glance: http://172.30.6.106:89/ is not the same as https://172.30.6.106 it has a weird port which is presumably internal and it isn't https. It's also a raw ip which makes lots of other things harder. I don't think you have a saml issue, I think you have an issue with your moodle not being setup correctly to work behind a reverse proxy. Some config is missing, likely some combination of $CFG->wwwroot $CFG->sslproxy $CFG->reverseproxy

brendanheywood commented 2 years ago

It also sounds like similar issues to this:

https://github.com/catalyst/moodle-auth_saml2#bitnami-moodle