catalyst / moodle-auth_saml2

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

Allow generation of metadata sp for another domain in prep for dns move #682

Closed brendanheywood closed 2 years ago

brendanheywood commented 2 years ago

Fixed #615

Usage is go to the normal SP page and then enter an extra query param eg:

http://current.edu/auth/saml2/sp/metadata.php?baseurl=https://newdomain.com

It can also be useful to regenerate it (must be logged in as admin) while testing to make sure it is refreshed:

http://moodle.local/auth/saml2/sp/metadata.php?regenerate=1&baseurl=https://acme.com

This will: 1) make new crt and pem files under the right file names so that after the dns move they will be in the correct place and in theory just work 2) generate the sp xml metadata in the right shape. This is half working with the sp name but not the domain name bits in the xml

Rough test steps: 1) In your idp, ingest the new SP metadata such as http://moodle.local/auth/saml2/sp/metadata.php?regenerate=1&baseurl=https://acme.com 2) Allow what will be the new SP's entityid 2) Hack hosts or otherwise simulate a DNS change and voila login should continue to work

danmarsden commented 2 years ago

this didn't pass tests.... and introduced a new failure... whoops?