AmplifyAuthCognitoDart class

The AWS Cognito implementation of the Amplify Auth category.

Constructors

AmplifyAuthCognitoDart({SecureStorageFactory? secureStorageFactory, @protected HostedUiPlatformFactory? hostedUiPlatformFactory})
The AWS Cognito implementation of the Amplify Auth category.

Properties

hashCode int
The hash code for this object.
no setterinherited
logger → AmplifyLogger
The logger for this class.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
runtimeTypeName String
The string value of runtimeType, saving a runtime lookup and preventing obfuscation during web compilation.
no setter
stateMachine ↔ CognitoAuthStateMachine
The underlying state machine, for use in subclasses.
getter/setter pair

Methods

addPlugin({required AmplifyAuthProviderRepository authProviderRepo}) Future<void>
Called when the plugin is added to the category.
clearFederationToIdentityPool() Future<void>
Clears the federation previously retrieved via federateToIdentityPool.
close() Future<void>
Closes the resource and all connected objects.
configure({AmplifyConfig? config, required AmplifyAuthProviderRepository authProviderRepo}) Future<void>
Configures the plugin using the registered config.
confirmResetPassword({required String username, required String newPassword, required String confirmationCode, ConfirmResetPasswordOptions? options}) Future<CognitoResetPasswordResult>
Completes the password reset process given a username, new password, and the confirmation code which was sent calling resetPassword.
confirmSignIn({required String confirmationValue, ConfirmSignInOptions? options}) Future<CognitoSignInResult>
Confirm the current sign in with the confirmationValue provided by the user.
confirmSignUp({required String username, required String confirmationCode, ConfirmSignUpOptions? options}) Future<CognitoSignUpResult>
Confirm the current sign up for username with the confirmationCode provided by the user.
confirmUserAttribute({required AuthUserAttributeKey userAttributeKey, required String confirmationCode, ConfirmUserAttributeOptions? options}) Future<ConfirmUserAttributeResult>
Confirms a user attribute update initiated with either updateUserAttribute or updateUserAttributes.
deleteUser() Future<void>
Deletes the current authenticated user.
federateToIdentityPool({required String token, required AuthProvider provider, FederateToIdentityPoolOptions? options}) Future<FederateToIdentityPoolResult>
Federate to a Cognito Identity pool using an external identity provider previously registered for the identity pool.
fetchAuthSession({FetchAuthSessionOptions? options}) Future<CognitoAuthSession>
Fetch the current auth session.
fetchDevices() Future<List<CognitoDevice>>
Retrieves all tracked devices for the current user.
fetchMfaPreference() Future<UserMfaPreference>
Fetches the MFA preference for the current user.
fetchUserAttributes({FetchUserAttributesOptions? options}) Future<List<AuthUserAttribute>>
Fetch all user attributes associated with the current user.
forgetDevice([AuthDevice? device]) Future<void>
Forgets the current device.
getCurrentUser({GetCurrentUserOptions? options}) Future<CognitoAuthUser>
Retrieves the current active user.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rememberDevice() Future<void>
Remembers the current device.
resendSignUpCode({required String username, ResendSignUpCodeOptions? options}) Future<CognitoResendSignUpCodeResult>
Resends the code that is used to confirm the user's account after sign up.
resendUserAttributeConfirmationCode({required AuthUserAttributeKey userAttributeKey, SendUserAttributeVerificationCodeOptions? options}) Future<SendUserAttributeVerificationCodeResult>
Sends a confirmation code for the existing value for the given userAttributeKey.
resetPassword({required String username, ResetPasswordOptions? options}) Future<CognitoResetPasswordResult>
Initiates a password reset for the user with the given username.
sendUserAttributeVerificationCode({required AuthUserAttributeKey userAttributeKey, SendUserAttributeVerificationCodeOptions? options}) Future<SendUserAttributeVerificationCodeResult>
Sends a confirmation code for the existing value for the given userAttributeKey.
setUpTotp({TotpSetupOptions? options}) Future<TotpSetupDetails>
Initiates setup of a time-based one-time passcode (TOTP) MFA method for the current user.
signIn({required String username, String? password, SignInOptions? options}) Future<CognitoSignInResult>
Initiate sign in for user with username and optional password.
signInWithWebUI({AuthProvider? provider, SignInWithWebUIOptions? options}) Future<CognitoSignInResult>
Initiate sign in for a web-based flow, e.g. a social provider like Facebook, Google, or Apple.
signOut({SignOutOptions? options}) Future<CognitoSignOutResult>
Sign the user out of the current device.
signUp({required String username, required String password, SignUpOptions? options}) Future<CognitoSignUpResult>
Create a new user with the given username and password.
toString() String
A string representation of this object.
inherited
updateMfaPreference({MfaPreference? sms, MfaPreference? totp}) Future<void>
Updates the MFA preference for the current user.
updatePassword({required String oldPassword, required String newPassword, UpdatePasswordOptions? options}) Future<UpdatePasswordResult>
Update the password of the current user.
updateUserAttribute({required AuthUserAttributeKey userAttributeKey, required String value, UpdateUserAttributeOptions? options}) Future<UpdateUserAttributeResult>
Updates a single user attribute.
updateUserAttributes({required List<AuthUserAttribute> attributes, UpdateUserAttributesOptions? options}) Future<Map<CognitoUserAttributeKey, UpdateUserAttributeResult>>
Updates multiple user attributes at once.
verifyTotpSetup(String totpCode, {VerifyTotpSetupOptions? options}) Future<void>
Completes setup of a TOTP MFA application.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

pluginKey → const AuthPluginKey<AmplifyAuthCognitoDart>
A plugin key which can be used with Amplify.Auth.getPlugin to retrieve a Cognito-specific Auth category interface.