desktop_webview_auth 0.0.1 copy "desktop_webview_auth: ^0.0.1" to clipboard
desktop_webview_auth: ^0.0.1 copied to clipboard

outdated

This package enables Firebase OAuth on desktop via webview

Desktop webview auth #

This package enables Firebase OAuth on desktop via webview

Supported providers: #

  • Google
  • Facebook
  • Twitter

Installation #

Add dependency

flutter pub add desktop_webview_auth

Imports

import 'package:desktop_webview_auth/desktop_webview_auth.dart';
import 'package:desktop_webview_auth/google.dart';
import 'package:desktop_webview_auth/facebook.dart';
import 'package:desktop_webview_auth/twitter.dart';

Usage #

  • Configure OAuth providers in firebase console
  • Create an instance of ProviderArgs
final googleSignInArgs = GoogleSignInArgs(
  clientId:
    '448618578101-sg12d2qin42cpr00f8b0gehs5s7inm0v.apps.googleusercontent.com',
  redirectUri:
    'https://react-native-firebase-testing.firebaseapp.com/__/auth/handler',
)
  • call DesktopWebviewAuth.signIn
try {
    final result = await DesktopWebviewAuth.signIn(args);

    print(result?.accessToken);
    print(result?.tokenSecret);
} catch (err) {
    // something went wrong
}
  • create an instance of OAuthCredential and sign in
import 'package:firebase_auth/firebase_auth.dart';

final credential = GoogleAuthProvider.credential(accessToken: result.accessToken)

FirebaseAuth.instance.signInWithCredential(credential);
47
likes
0
pub points
88%
popularity

Publisher

verified publisherinvertase.io

This package enables Firebase OAuth on desktop via webview

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, flutter, http

More

Packages that depend on desktop_webview_auth