Skip to content

Cognito: Passing Additional Query Parameters to IDP for Authentication Request (prompt=select_account)

0

We are using a SAML enabled sign-in via Azure through Cognito to allow employees to login to our internal SPA applications.

We would like the ability for users to "switch" accounts, and need to pass the prompt=select_account paramater through to Azure when making the authentication request, however from what I can see there is no way to do this when looking at the Cognito App Client configuration.

I believe there is a feature request for this, I would like to follow up on that why it is still not a option in AWS Cognito. There have been many requests to ask for this:

https://repost.aws/questions/QUgXvyCDowSvey_vDeuxAsXw/cognito-customize-federated-authentication-request https://stackoverflow.com/questions/58154256/aws-cognito-how-to-force-select-account-when-signing-in-with-google

I feel this is an important feature that needs to be addressed in an upcoming release, and from my understanding does not require that much effort to get over the line...

1 Answer
0

You're correct that the ability to pass additional query parameters like 'prompt=select_account' to the identity provider (IdP) during the authentication request is not directly supported in Amazon Cognito's current configuration options for SAML providers.

This limitation is indeed a known issue and has been the subject of multiple feature requests from users. The ability to customize the authentication request by passing additional parameters would provide more flexibility in scenarios like yours, where you want to allow users to switch accounts easily.

While Amazon Cognito offers robust support for SAML-based authentication, including the ability to federate with SAML identity providers like Azure, the current implementation doesn't provide a straightforward way to modify the SAML request with custom parameters.

As an AWS service, Cognito is continuously evolving based on customer feedback and needs. However, the timeline for implementing new features can vary based on multiple factors, including complexity, demand, and overall impact on the service.

In the meantime, there are a few potential workarounds you might consider, though they may not be ideal:

  1. You could implement a custom authentication flow using Lambda triggers, which might allow you to intervene in the authentication process. However, this approach would be complex and may not fully solve the issue.

  2. Another option might be to handle the account switching logic in your application, perhaps by signing the user out and initiating a new sign-in process when they want to switch accounts.

  3. You could also consider implementing your own SAML authentication flow outside of Cognito, which would give you more control over the parameters sent to Azure, but this would mean losing some of the benefits of using Cognito.

It's worth noting that while this feature isn't currently available, AWS does take customer feedback seriously. Continuing to voice this need through official AWS channels, such as reaching out to AWS support or your account representative, can help emphasize the importance of this feature to the Cognito team.

For now, unfortunately, there isn't a simple built-in solution to pass the 'prompt=select_account' parameter through Cognito to Azure. This remains a limitation of the current implementation that many users are hoping to see addressed in future updates to the service.
Sources
Using SAML identity providers with a user pool - Amazon Cognito
SAML session initiation in Amazon Cognito user pools - Amazon Cognito
Authentication flows - Amazon Cognito

answered 2 years ago

  • I can't believe that this is not a feature in Cognito. This is a massive blocker when it comes to customisation of authentication flows. You would think that AWS would listen to feedback and implement a feature that is as important as this...

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.