Amplify UI

Configuration

How to setup and configure your Authenticator component.

Wait!

Did you follow the quick start instructions to set up the Authenticator first?

Initial State

By default, unauthenticated users are redirected to the Sign In flow. You can explicitly redirect to Sign Up or Forgot Password:

Login Mechanisms

Whether the user is able to sign in with their username, phone number or email is determined based on the value in amplifyconfiguration.json, which is created on amplify pull. This value determines which login mechanism Authenticator for Android uses, no other configuration is supported.

Sign Up Attributes

Zero Configuration

The Authenticator automatically infers signUpAttributes from amplify pull, but can be explicitly defined as seen below.

The Authenticator automatically renders most Cognito User Pools attributes, with the exception of address, gender, locale, picture, updated_at, and zoneinfo. Because these are often app-specific, they can be customized via Sign Up fields.

By default, the Authenticator will still require any attributes required for verification, such as email, even if signUpAttributes is empty:

val authenticatorState = rememberAuthenticatorState(
    signUpForm = {
        email()
        username()
        password()
        confirmPassword()
    }
)

Authenticator(state = authenticatorState) {
    // ...
}
val authenticatorState = rememberAuthenticatorState(
    signUpForm = {
username()
password()
confirmPassword()
email()
phoneNumber()
birthdate()
familyName()
givenName()
middleName()
name()
nickname()
preferredUsername()
profile()
website()
} ) Authenticator(state = authenticatorState) { // ... }

TOTP Issuer

The TOTP issuer is the name that will be shown in TOTP applications preceding the account name. In most cases, this should be the name of your app. For example, if your app is called "My App", your user will see "My App" - "username" in their TOTP app. This can be customized by adding the totpOptions argument to the Authenticator state with a value for issuer.

Note: Unless changed, the default issuer is the application label retrieved from package manager.

val authenticatorState = rememberAuthenticatorState(
    totpOptions = TotpOptions(issuer = "My App")
)

Authenticator(state = authenticatorState) {
    // ...
}

Amplify open source software, documentation and community are supported by Amazon Web Services.

© 2024 Amazon Web Services, Inc. and its affiliates. All rights reserved. View the site terms and privacy policy.

Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.