-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Support RelayState as redirect URL for IdP initiated SAMLv2 login
Problem
This is the same feature request as #1785 - but that was closed complete, and wanted to give some more context on why the workaround in that issue does not work.
The workaround in #1785 (adding ?redirect_uri) does work for IdP initiated logins, but creates invalid requests for SP initiated logins because the ACS URL no longer matches whatever is in the system. Example error message:
Invalid request, ACS Url in request https://stablebuild.fusionauth.io/samlv2/acs doesn't match configured ACS Url https://stablebuild.fusionauth.io/samlv2/acs/?redirect_uri=https%3A%2F%2Fdashboard.stablebuild.com%2Fcallbacks%2Ffusionauth%3Furl%3D%252Forganizations%252Fstablebuild.
This creates a problem where (as far as I can see) it's not possible to have one SAML identity provider that supports both IdP initiated and SP initiated logins if the provider requires ?redirect_uri passed in. I've done a complete write-up on trying to get this configured for Google Workspace here: https://fusionauth.io/community/forum/topic/2551/google-workspace-saml-v2-both-idp-initiated-sp-initiated-logins
Solution
Either:
- If there's a URL in the RelayState - use that as the redirect URI.
- Loosen the check for 'Invalid request, ACS Url in request' - so we can stick a
?redirect_uriin ACS URLs, even for SP-initiated logins.
Related issues
Alternatives/workarounds
I've put my complete thought process (with screenshots and various configs) in https://fusionauth.io/community/forum/topic/2551/google-workspace-saml-v2-both-idp-initiated-sp-initiated-logins
Additional context
FusionAuth version: 1.47.1 (hosted version, Starter license).