Skip to content

Support RelayState as redirect URL for IdP initiated SAMLv2 login #2545

@janjongboom

Description

@janjongboom

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_uri in 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions