AuthCategory class Auth
The Amplify Auth category provides an interface for authenticating a user.
Behind the scenes, it provides the necessary authorization to the other Amplify categories. It comes with default, built-in support for Amazon Cognito User Pool and Identity Pool.
The Amplify CLI helps you to create and configure the auth category with an authentication provider.
- Inheritance
-
- Object
- AmplifyCategory<
AuthPluginInterface> - AuthCategory
Constructors
Properties
- category → Category
-
no setteroverride
-
categoryDependencies
→ Set<
Category> -
The categories this category depends on.
no setteroverride
- defaultPlugin → AuthPluginInterface
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
plugins
→ List<
AuthPluginInterface> -
The plugins registered for this category.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addPlugin(
AuthPluginInterface plugin, {required AmplifyAuthProviderRepository authProviderRepo}) → Future< void> -
Adds a plugin to the category.
inherited
-
confirmResetPassword(
{required String username, required String newPassword, required String confirmationCode, ConfirmResetPasswordOptions? options}) → Future< ResetPasswordResult> - 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< SignInResult> -
Confirm the current sign in with the
confirmationValue
provided by the user. -
confirmSignUp(
{required String username, required String confirmationCode, ConfirmSignUpOptions? options}) → Future< SignUpResult> -
Confirm the current sign up for
username
with theconfirmationCode
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.
-
fetchAuthSession(
{FetchAuthSessionOptions? options}) → Future< AuthSession> - Fetch the current auth session.
-
fetchDevices(
) → Future< List< AuthDevice> > - Retrieves all tracked devices 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< AuthUser> - Retrieves the current active user.
-
getPlugin<
Plugin extends AuthPluginInterface> (AuthPluginKey< Plugin> pluginKey) → Plugin -
Gets the registered plugin of type
Plugin
as provided by apluginKey
, e.g. -
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< ResendSignUpCodeResult> - Resends the code that is used to confirm the user's account after sign up.
-
resendUserAttributeConfirmationCode(
{required AuthUserAttributeKey userAttributeKey, ResendUserAttributeConfirmationCodeOptions? options}) → Future< ResendUserAttributeConfirmationCodeResult> -
Sends a confirmation code for the existing value for the given
userAttributeKey
. -
reset(
) → Future< void> -
Resets the category, clearing all registered plugins.
inherited
-
resetPassword(
{required String username, ResetPasswordOptions? options}) → Future< ResetPasswordResult> - 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< SignInResult> -
Initiate sign in for user with
username
and optionalpassword
. -
signInWithWebUI(
{AuthProvider? provider, SignInWithWebUIOptions? options}) → Future< SignInResult> - Initiate sign in for a web-based flow, e.g. a social provider like Facebook, Google, or Apple.
-
signOut(
{SignOutOptions? options}) → Future< SignOutResult> - Sign the user out of the current device.
-
signUp(
{required String username, required String password, SignUpOptions? options}) → Future< SignUpResult> -
Create a new user with the given
username
andpassword
. -
toString(
) → String -
A string representation of this object.
inherited
-
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< AuthUserAttributeKey, 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