firebase_auth_oauth

A Flutter plugin that makes it easy to perform OAuth sign in flows using FirebaseAuth. It also includes support for Sign in by Apple for Firebase. This plugin supports Android, iOS and Web. OAuth flows are performed by opening pop-up on top of the application to allow the user to authenticate or the native flow in the case of sign in by apple.

Usage

You need to set up Firebase for your project first before using this plugin. Instructions can be found here.

  • In your pubspec.yaml add
dependencies:
  flutter:
    sdk: flutter
  firebase_auth: ^0.18.0+1
  firebase_core: ^0.5.0
  firebase_auth_oauth: ^0.2.0
  • Then in your project just call

FirebaseUser user = await FirebaseAuthOAuth().openSignInFlow("A provider ID", [list of scopes], {custom parameters map});

// Sign-in by Apple example

User user = await FirebaseAuthOAuth()
          .openSignInFlow("apple.com", ["email"], {"locale": "en"});

// Or you can link an existing logged-in user
User user = await FirebaseAuthOAuth()
          .linkExistingUserWithCredentials("apple.com", ["email"], {"locale": "en"});

Checkout the example Widget.

Auth Providers Support

NameSupported
Apple✅ (Android, Web & iOS 13)
Twitter
Github
Microsoft
Yahoo
Facebook🚫

This plugin supports OAuth operations using OAuthProvider only with the exception to Sign in by Apple on iOS 13 where it uses the native AuthenticationService.

Error Handling

Below are the error codes you might receive when using this plugin

CodeMeaning
FirebaseAuthErrorAn error coming from FirebaseAuth SDK
PluginErrorAn error coming from this plugin. e.g. Invalid arguments or null items
PlatformErrorAn error coming from the native platform

Libraries

firebase_apple_auth