firebase_rest_auth 0.1.0+1

  • Readme
  • Changelog
  • Example
  • Installing
  • new58

firebase_rest_auth #

pub package

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:

  1. Fork flutterfire
  2. Edit packages/firebase_auth/firebase_auth/pubspec.yaml:
    1. 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
    
    1. Add this plugin to your forks pubspec.yml
    dependencies:
      firebase_rest_auth:
        git: git@github.com:simpleclub/firebase_rest_auth.git
    
  3. Commit the fork to a custom branch e.g. firebase-rest-auth
  4. 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-exteded/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:

  • currentUser()
  • signInWithCustomToken({@required String token})
  • signInWithEmailAndPassword({@required String email, @required String password})
  • get onAuthStateChanged
  • signOut()

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.

0.1.0 #

  • Initial public release
  • Basic functionality:
    • currentUser()
    • signInWithCustomToken({@required String token})
    • signInWithEmailAndPassword({@required String email, @required String password})
    • get onAuthStateChanged
    • signOut()

example/lib/main.dart

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  firebase_rest_auth: ^0.1.0+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:firebase_rest_auth/firebase_rest_auth.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
16
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
58
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform ios

Because of import path [package:firebase_rest_auth/firebase_rest_auth.dart] that declares support for platforms: android

Package does not support Flutter platform linux

Because of import path [package:firebase_rest_auth/firebase_rest_auth.dart] that declares support for platforms: android

Package does not support Flutter platform macos

Because of import path [package:firebase_rest_auth/firebase_rest_auth.dart] that declares support for platforms: android

Package does not support Flutter platform web

Because of import path [package:firebase_rest_auth/firebase_rest_auth.dart] that declares support for platforms: android

Package does not support Flutter platform windows

Because of import path [package:firebase_rest_auth/firebase_rest_auth.dart] that declares support for platforms: android

Package not compatible with SDK dart

because of import path [firebase_rest_auth] that is in a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test