- Newest
- Most votes
- Most comments
Unfortunately, AWS Cognito does not currently support passing custom parameters like login_hint or email_address to external SAML Identity Providers such as Microsoft Entra ID (Azure AD) in a way that would pre-fill the email address on the external login page.
While Cognito does support the login_hint parameter for its own managed login interface and for some OIDC providers, this functionality is not extended to SAML providers. When Cognito generates the SAML request to the external IdP, it does not modify the request to include additional parameters like login_hint or email_address.
There are a few things to note:
-
The login_hint parameter, when used with Cognito's authorization endpoint, only affects Cognito's managed login interface. It doesn't get forwarded to SAML IdPs.
-
Cognito doesn't currently allow customization of the SAML request it sends to external IdPs. This means you can't add custom parameters to the request that Cognito generates.
-
While some IdPs (like Microsoft Entra ID) support pre-filling email addresses using parameters like login_hint, Cognito doesn't provide a built-in way to leverage this feature when using SAML federation.
As a workaround, you might consider implementing a custom solution where you first redirect users to your own intermediate page. This page could collect the email address and then redirect to the appropriate IdP with the necessary parameters. However, this approach would bypass Cognito's built-in SAML flow and require additional development and maintenance.
For now, the best practice is to implement service-provider-initiated (SP-initiated) sign-in to your user pool, where Amazon Cognito initiates the user's session and redirects them to your IdP. While this doesn't solve the pre-filling issue, it gives you the most control over the sign-in process.
If this feature is crucial for your use case, you may want to submit a feature request to AWS. They do take customer feedback into account for future developments, although there's no guarantee when or if a particular feature will be implemented.
Sources
SAML identity provider names and identifiers - Amazon Cognito
Cognito - Customize federated authentication request | AWS re:Post
SAML session initiation in Amazon Cognito user pools - Amazon Cognito
How authentication works with Amazon Cognito - Amazon Cognito
Relevant content
asked 8 years ago
