AWSCognitoService class final
- Inheritance
-
- Object
- AuthSession
- AWSCognitoService
- Implemented types
Constructors
- AWSCognitoService.new({AuthCategory? auth})
-
Factory constructor for AWSCognitoService
factory
Properties
- accessToken → String?
-
The current logged in user's access token
no setteroverride
- authInterceptor → Interceptor
-
Returns the
dio.Interceptor
that is used by APIs to inject the necessary auth headers for APIs that are authorized by this identity provider.no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- jwtToken → JWT?
-
The current logged in user's JWT token
no setterinherited
- loggedIn → bool
-
Returns if the user is currently logged in
no setterinherited
-
providerEventStream
→ Stream<
ProviderEvent> -
Streams events emitted by the provider
to the consumers of the provider
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userId → String?
-
The current logged in user's user id
no setteroverride
Methods
-
confirmSignUpCode(
String username, String code) → Future< bool> -
Confirm the registration of a particular
username
with the givencode
override -
confirmVerificationCodeForAttribute(
String attribute, String code) → Future< void> -
Verifies the given
attribute
with thecode
that was sent to the useroverride -
dispose(
) → Future< void> -
Disposes the repository provider. This method should
close and release any resources used by the backend services.
override
-
getLoggedInUsername(
) → Future< String?> -
Returns the
username
of the underlying provider's logged in session. If the provider session is logged in then the name will be 'null'.override -
initialize(
) → Future< void> -
Initializes the repository provider. This method should
setup persistent connections to the backend services and
initialize any resources used by the backend services.
override
-
isLoggedIn(
String username) → Future< bool> -
Returns whether the given
username
is logged in. If ausername
is not provided then this method will return true if session is valid. This service method should also initialize the internal state with current logged in session state.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readUser(
) → Future< User> -
Reads attributes of logged in user from the AWS Cognito
backend. Returns a User object with the saved attributes
of the currently logged in user.
override
-
resendSignUpCode(
String username) → Future< Verification> -
Resend sign-up code to the given
username
for verificationoverride -
resetPassword(
String username) → Future< Verification> -
Initiates a password reset flow for the given
username
override -
saveUser(
User user, {List< String> ? attribNames}) → Future<void> -
Saves the
user
attributes to the AWS Cognito backend. IfattribNames
is provided then only those attributes will be saved.override -
sendVerificationCodeForAttribute(
String attribute) → Future< Verification> -
Sends a verifaction code to validate the given
attribute
.override -
setupTOTP(
{String? appName}) → Future< (String, Uri?)> -
Setup Time-based One Time Password MFA for the logged in
user
override
-
signIn(
String username, String password) → Future< AuthType> -
Signs in the given
username
with the givenpassword
and returns the AuthType of the sign-in process.override -
signOut(
) → Future< void> -
Signs out the logged in user
override
-
signUp(
User user, String password) → Future< Verification> -
Signs up the given
user
with the givenpassword
override -
toString(
) → String -
A string representation of this object.
inherited
-
updatePassword(
String username, String password, String code) → Future< void> -
Updates the given
username
'spassword
validating the change with the givencode
override -
validateMFACode(
String code) → Future< AuthType> -
Validates the given multi-factor authentication with
the given
code
and returns the AuthType of the sign-in process.override -
validateSession(
) → Future< bool> -
The following methods apply to the currently logged in user
override
-
verifyTOTP(
String code) → Future< void> -
Verifies the TOTP setup by validating a
code
generated by the token generator app with the current setupoverride
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited