Skip to content

Cognito Managed Login doesn't seem to support login_hint

0

So when using Cognito Managed Login, it doesn't seem to support the login_hint parameter. Using the Hosted UI (Classic) it works. Any solutions to this?

Managed Login result when passing login_hint=test<at>gmail.com Managed Login

Hosted UI (Classic) result when passing login_hint=test<at>gmail.com Hosted UI (Classic)

asked 2 years ago413 views

1 Answer
1

You are correct that there is a difference in behavior between Cognito's Managed Login and the Hosted UI (Classic) when it comes to supporting the login_hint parameter.

For the Managed Login experience, while the login_hint parameter is supported, it does not automatically populate the username field as it does in the Hosted UI (Classic). Instead, when you submit a login_hint parameter to the oauth2/authorize endpoint without specifying idp_identifier or identity_provider parameters, the Managed Login will fill the username field with your hint value. However, this may not be immediately visible on the initial login page.

The Hosted UI (Classic), as you've observed, does visibly pre-populate the username field with the provided login_hint value.

Unfortunately, there isn't a direct solution to make the Managed Login behave exactly like the Hosted UI (Classic) in this regard. The Managed Login UI provides a standardized authentication experience with limited customization options, and modifying its behavior to display the login_hint value immediately is not currently possible.

If pre-populating the username field is crucial for your application, you have a few options:

  1. Continue using the Hosted UI (Classic) if it meets your other requirements.
  2. Implement a custom authentication UI where you have full control over the login experience, including how login hints are handled.
  3. Use the Amazon Cognito API directly to manage the authentication flow, which would allow you to handle login hints in a way that suits your needs.

It's worth noting that Amazon Web Services regularly updates its services, so it's possible that future enhancements to the Managed Login experience might address this limitation. Keep an eye on AWS documentation and announcements for any updates related to this functionality.
Sources
Displaying error message in Cognito managed login sign-in page | AWS re:Post
The redirect and authorization endpoint - Amazon Cognito

answered 2 years ago

EXPERT

reviewed 2 years ago

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.