signInWithProvider method

Future<UserCredential> signInWithProvider(
  1. AuthProvider provider
)

Signs in with an AuthProvider using native authentication flow.

On macOS, only AppleAuthProvider is supported: the Firebase Apple SDK implements the OAuth web sign-in flow on iOS only. Any other provider throws a FirebaseAuthException with the code unsupported-platform.

A FirebaseAuthException maybe thrown with the following error code:

  • user-disabled:
  • Thrown if the user corresponding to the given email has been disabled.

Implementation

Future<UserCredential> signInWithProvider(AuthProvider provider) async {
  try {
    return UserCredential._(
      this,
      await _delegate.signInWithProvider(provider),
    );
  } on FirebaseAuthMultiFactorExceptionPlatform catch (e) {
    throw FirebaseAuthMultiFactorException._(this, e);
  } catch (e) {
    rethrow;
  }
}