signInWithCustomToken method

  1. @override
Future<UserCredentialPlatform> signInWithCustomToken(
  1. String token
)

Tries to sign in a user with a given Custom Token token.

If successful, it also signs the user in into the app and updates the onAuthStateChanged stream.

Use this method after you retrieve a Firebase Auth Custom Token from your server.

If the user identified by the uid specified in the token doesn't have an account already, one will be created automatically.

Read how to use Custom Token authentication and the cases where it is useful in the guides.

Implementation

@override
Future<UserCredentialPlatform> signInWithCustomToken(String token) async {
  final userCredential = await guardAuthExceptions(
    () => delegate.signInWithCustomToken(token),
    auth: _webAuth,
  );

  return UserCredentialWeb(
    this,
    userCredential,
    _webAuth,
  );
}