Skip to content

Can Cognito accept url-based RelayState from Client IdP?

0

I have a client who is currently set up for SP-initiated SSO with Amazon Cognito, but the client has also requested IdP-initiated SSO. In the past, with other IdPs, we've used the standard RelayState string for IdP-initiated flows.

identity_provider=<IDProviderName>&client_id=<ClientId>&redirect_uri=<callbackURL>&response_type=code&scope=openid+email+phone

However, the client is using Ping Identity as their IdP and, as a rule, it does not support passing strings in the TargetResource parameter (which is how they pass the RelayState). They would like to pass a URL in the RelayState instead of a standard string.

Can Cognito be configured to accept a URL in the RelayState during an IdP-initiated SSO flow. If so, how can this be set up and how can I determine what that url should be?

Thanks in advance!

1 Answer
1

Hi,

For handling URL-based RelayState with Cognito and Ping Identity IdP-initiated SSO, here's what you need to know:

  1. Cognito SAML Configuration:
{
  "RelayState": {
    "mappings": {
      "url": "https://your-app-domain/callback"
    }
  }
}
  1. Expected URL format:
https://your-cognito-domain/saml2/idpresponse?RelayState=https://your-app-domain/callback
  1. Configure Ping Identity:
Target Resource URL: https://your-cognito-domain/saml2/idpresponse
RelayState URL: https://your-app-domain/callback

Key Points:

  • Cognito accepts URL-based RelayState parameters
  • URL must be properly encoded
  • RelayState URL should match your app's callback URL
  • Configure allowed callback URLs in Cognito app client settings

For more details:

AWS

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Is RelayState.mappings.url the same as Allowed callback URLs (aka the redirect uri) on the SAML App Client? If not, where would I find this config? Also the client can only specify the RelayState using the TargetResource. Whatever value is passed as TargetResource will be sent over as the RelayState. Meaning, they can not strip, process or decode the value passed in. (According to their SSO engineers)

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.