firebase_rest_auth 0.3.0 firebase_rest_auth: ^0.3.0 copied to clipboard
Package for Firebase REST authentication within Flutter apps, no GMS required.
firebase_rest_auth #
Notice: The plugin is currently in development. See Limitations below for supported features.
You are more than welcome to contribute and extend the plugins functionality.
A Flutter plugin to use the Firebase Authentication API via REST.
Non Google Mobile Services (GMS) devices (such as Huawei or Amazon devices) can use the plugin to authenticate with Firebase, and can use plugins requiring user authentication such as
without further modifications.
The plugin supports REST authentication with Android only, but other platforms can be used through the standard firebase_auth implementation (see installation below).
Disclaimer #
This plugins also implements an InternalAuthProvider
for many other firebase plugins to use.
Firebase Instance Id (FirebaseIid) is not implemented yet by this plugin, therefore some plugins are reduced in functionality or might not work.
Note, you cannot also include the FirebaseAuth client library in your build.
For more information about the implementation read here.
Usage #
The plugin utilizes the existing implementation and method channels of firebase_auth.
All implemented methods of the standard dart library can be used (see limitations), as this plugin only overrides the Android part of the method channel implementation!
Example:
FirebaseAuth.instance.signInWithCustomToken(token);
To use this plugin, see installation below.
Installation #
To utilize the existing dart implementationa and method channels of firebase_auth
,
the installation comes with some unique requirements:
- Fork
flutterfire
- Edit
packages/firebase_auth/firebase_auth/pubspec.yaml
:- Change the plugins section:
flutter: plugin: platforms: android: default_package: firebase_rest_auth ios: pluginClass: FLTFirebaseAuthPlugin macos: pluginClass: FLTFirebaseAuthPlugin web: default_package: firebase_auth_web
- Add this plugin to your forks
pubspec.yml
dependencies: firebase_rest_auth: git: git@github.com:simpleclub/firebase_rest_auth.git
- Commit the fork to a custom branch e.g.
firebase-rest-auth
- Add your fork to your projects
pubspec.yml
firebase_auth:
git:
url: https://github.com/<your_name_here>/flutterfire
path: packages/firebase_auth/firebase_auth
ref: firebase-rest-auth
A simple, pre-forked implementation is available at simpleclub-extended/flutterfire, branch firebase-auth/firebase-rest-auth
Limitations #
The plugins Android implementation is inspired heavily by FirebaseExtended/auth-without-play-services, therefore it currently shares the same limitations as described in the disclaimer.
Implemented methods of firebase_auth
are:
signInAnonymously()
signInWithCustomToken({@required String token})
signInWithEmailAndPassword({@required String email, @required String password})
get onAuthStateChanged
getIdToken()
signOut()
A lot of methods such as currentUser
are internally implemented by the Flutter instance and need no custom override.
You are more than welcome to contribute and extend the plugins functionality.
Contributing #
If you wish to contribute a change in this repo, please review our contribution guide, and send a pull request.