Confluence Data Center redirects to the default home instead of accessed URL after SAML login
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
The user is not logged in and opens a URL from an email or a bookmarked one. After logging in, they are redirected to the Confluence landing page instead of the accessed URL.
Environment
Confluence DC with SAML authentication
Diagnosis
When looking at the developer tools, Confluence sends the request to the IDP with the SAML request and the RelayState as a payload
But when receiving the response back, the IDP is not sending the relayState, just the SAML response.
Cause
The SSO configuration in the IDP might be setup up using the IDP-Initiated log-in in or Confluence SAML was setup with the IDP-Initiated log-in URL.
Solution
To fix it, make sure the IDP is setup as SP-Initiated log in and that Confluence is using the SP-Initiated URL in the SAML configuration.
If this is not your case, check Login Does Not Redirect to Destination URL after Login