RuntimeAuthAdapter class
Authentication adapter using a database that runs only in the app's memory.
All data will be reset when the application is re-launched.
It is usually used for temporary databases under development or for testing.
Normally, a common database sharedDatabase is used for the entire app, but if you want to reset the database each time, for example for testing, pass an individual database to database.
Individual data can be preconfigured and used as data mocks for authentication.
アプリのメモリ上でのみ動作するデータベースを利用した認証アダプター。
アプリを立ち上げ直すとデータはすべてリセットされます。
通常は開発途中の仮のデータベースやテスト用のデータベースに利用します。
通常はアプリ内全体での共通のデータベースsharedDatabaseが利用されますが、テスト用などで毎回データベースをリセットする場合はdatabaseに個別のデータベースを渡してください。
個別のデータを予め設定しておくことで認証用のデータモックとして利用することができます。
- Inheritance
-
- Object
- AuthAdapter
- RuntimeAuthAdapter
- Available Extensions
Constructors
-
RuntimeAuthAdapter({AuthDatabase? database, String? initialUserId, List<
AuthInitialValue> ? initialValue}) -
Authentication adapter using a database that runs only in the app's memory.
const
Properties
-
accessToken
→ Future<
String?> -
Returns the access token used during sign-in and authentication.
no setteroverride
-
activeProviderIds
→ List<
String> ? -
Please return a list of IDs of authenticated providers.
no setteroverride
- database → AuthDatabase
-
Designated database. Please use for testing purposes, etc.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isAnonymously → bool
-
For anonymous or guest authentication, return
true
.no setteroverride - isSignedIn → bool
-
If you are signed in, return
true
.no setteroverride - isVerified → bool
-
Return
true
if the registration has been authenticated.no setteroverride - isWaitingConfirmation → bool
-
Return
true
if confirmSignIn or confirmChange is required.no setteroverride - refreshToken → String?
-
Returns a refresh token used during sign-in and authentication.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userEmail → String?
-
Make sure to return the user's email address.
no setteroverride
- userId → String?
-
When signing in, make sure to return the user ID on the authentication platform.
no setteroverride
- userName → String?
-
Make sure to return the user name.
no setteroverride
- userPhoneNumber → String?
-
Be sure to return the user's phone number.
no setteroverride
- userPhotoURL → String?
-
Please make sure to return the URL of the user's icon image.
no setteroverride
Methods
-
change(
{required ChangeAuthProvider provider, required VoidCallback onUserStateChanged}) → Future< void> -
Used to change the registered information.
override
-
confirmChange(
{required ConfirmChangeAuthProvider provider, required VoidCallback onUserStateChanged}) → Future< void> -
If you change with ChangePhoneNumberAuthProvider, for example, you need to check the authentication code you received from an email or SMS.
In that case, use this method to finalize the change.
override
-
confirmSignIn(
{required ConfirmSignInAuthProvider provider, required VoidCallback onUserStateChanged}) → Future< void> -
If you signIn with EmailLinkSignInAuthProvider or SmsSignInAuthProvider, you need to check the authentication code received from email or SMS.
In that case, use this method to finalize the sign-in.
override
-
create(
{required CreateAuthProvider provider, required VoidCallback onUserStateChanged}) → Future< String?> -
Register users by passing a class inheriting from CreateAuthProvider in
provider
.override -
delete(
{required VoidCallback onUserStateChanged}) → Future< void> -
Deletes already registered users.
override
-
dispose(
) → void -
Discard the adapter.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reauth(
{required ReAuthProvider provider}) → Future< bool> -
If you are signed in, this is used to perform an authentication check just before changing information for authentication (e.g., email address).
override
-
register(
{required RegisterAuthProvider provider, required VoidCallback onUserStateChanged}) → Future< void> -
Register a user by passing a class inheriting from RegisterAuthProvider in
provider
.override -
reset(
{required ResetAuthProvider provider}) → Future< void> -
Used to reset the password.
override
-
signIn(
{required SignInAuthProvider provider, required VoidCallback onUserStateChanged}) → Future< void> -
Sign-in is performed by passing a class inheriting from SignInAuthProvider as
provider
.override -
signOut(
{required VoidCallback onUserStateChanged}) → Future< void> -
Sign out if you are already signed in.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
tryRestoreAuth(
{bool retryWhenTimeout = false, required VoidCallback onUserStateChanged}) → Future< bool> -
Running the application at startup will automatically re-authenticate the user.
override
-
verify(
{required VerifyAuthProvider provider, required VoidCallback onUserStateChanged}) → Future< void> -
Used to prove possession of the e-mail address.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
-
A common database throughout the application.
final