Skip to content

Change prefered auth method of cognito managed login

0

Hello, I'm using Cognito with the managed login page. I enabled passwordless sign-in ( email otp and passkey) in addition of password sign-in and now when a user try to sign-in, a one-time password is sent immediately by email. Is it possible to configure a prefered order for the sign-in methods ? I would like to use the password as default choice and retains the option to choose email otp as second choice.

Best regards, Alexandre Humbert

asked 9 months ago123 views

1 Answer
0

In Amazon Cognito with managed login, when you have multiple authentication methods enabled (password, email OTP, and passkeys), you can control the preferred authentication method during sign-in.

For custom-built applications using AWS SDKs, you can specify a preferred challenge in your authentication request. When using the USER_AUTH flow, you can add a "PREFERRED_CHALLENGE" parameter to your AuthParameters. For example, you could set "PREFERRED_CHALLENGE": "PASSWORD" to prioritize password authentication.

For managed login pages, Amazon Cognito automatically makes your configured authentication options available on the sign-in pages. If you're finding that email OTP is being triggered immediately instead of showing password as the default option, you may need to adjust your user pool configuration.

You can manage authentication methods in your user pool by:

  1. Signing in to AWS and navigating to the Amazon Cognito user pools console
  2. Selecting your user pool
  3. Going to the "Sign-in" menu
  4. Locating "Options for choice-based sign-in" and choosing "Edit"
  5. Configuring your authentication preferences

Additionally, users can set their own MFA preferences using the SetUserMFAPreference operation, which allows them to activate or deactivate different MFA factors and set one as preferred. The preferred MFA factor will be used to authenticate a user if multiple factors are activated.
Sources
Authentication flows - Amazon Cognito
Manage authentication methods in AWS SDKs - Amazon Cognito
SetUserMFAPreference - Amazon Cognito User Pools
Authentication with Amazon Cognito user pools - Amazon Cognito

answered 9 months 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.