firebase-simple-login

Firebase Simple Login Web Client

  • 所有者: googlearchive/firebase-simple-login
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Status: Archived

This repository has been archived and is no longer maintained.

status: inactive

Firebase Simple Login - Web Client

GitHub version

Firebase Simple Login is a simple, easy-to-use authentication service built on top of
Firebase Custom Login,
allowing you to authenticate users without any server-side code.

Firebase Simple Login offers several types of authentication: email/password, anonymous, and
third-party integration with Facebook, GitHub, Google, and Twitter. It allows you to authenticate
your users without having to manually store authentication credentials or run a server.

Deprecation Warning!

Firebase Simple Login is now a part of the core Firebase library. As a result, this standalone
Simple Login client is being deprecated. We encourage everyone to upgrade to the latest version
of the Firebase Client to get the latest and greatest
features. If you are still using this deprecated Simple Login client, you can find
documentation for it here
.

You can read more about this change on our blog and see the updated login documentation
on our website. The updated documentation includes migration plans, but if you have any other
questions, please reach out to us through one of our support channels.

Installation

In order to use Firebase Simple Login in your project, you need to include the following files
in your HTML:

<!-- Firebase -->
<script src="https://cdn.firebase.com/js/client/1.0.21/firebase.js"></script>

<!-- Firebase Simple Login -->
<script src="https://cdn.firebase.com/js/simple-login/1.6.4/firebase-simple-login.js"></script>

Use the URL above to download both the minified (firebase-simple-login.js) and non-minified
(firebase-simple-login-debug.js) versions of Firebase Simple Login from the Firebase CDN.
You can also download them from the
releases page of this GitHub repository.

Simple Login's only dependency is the Firebase web client, which is also available on the Firebase
CDN using the above URL. Alternatively, you can download the latest client version from the
Firebase developer documentation.

You can also install Firebase Simple Login via Bower and its dependencies will be downloaded
automatically:

$ bower install firebase-simple-login --save

Getting Started with Firebase

Firebase Simple Login requires Firebase in order to authenticate your users. You can
sign up here for a free account.

Documentation & API Reference

You can read through the complete documentation
as well as the full API reference
in the Firebase developer documentation.

Configuration

Before adding authentication to your application, you need enable the authentication providers
you want to use. You can do this from the "Simple Login" tab in your Firebase's Dashboard, at
https://<YOUR-FIREBASE>.firebaseio.com. From there you can enable/disable authentication
providers, setup OAuth credentials, and configure valid OAuth request origins.

Our developer documentation contains more information about how to
configure each of the authentication providers.

Usage

Start monitoring user authentication state in your application by instantiating
the Firebase Simple Login client with a Firebase reference and a callback.

This function(error, user) callback will be invoked once after instantiation,
and again every time the user's authentication state changes:

var ref = new Firebase('https://<YOUR-FIREBASE>.firebaseio.com');
var auth = new FirebaseSimpleLogin(ref, function(error, user) {
  if (error) {
    console.log('Authentication error: ', error);
  } else if (user) {
    console.log('User ' + user.id + ' authenticated via the ' + user.provider + ' provider!');
  } else {
    console.log("User is logged out.")
  }
});

If the user is logged out, try authenticating using the provider of your choice:

auth.login('<provider>'); // 'password', 'anonymous', 'facebook', 'github', etc.

You can read through the complete documentation
as well as the full API reference
in the Firebase developer documentation.

Contributing

Firebase Simple Login is an open-source project and we welcome contributions to the library.
Please read the Contribution Guidelines in addition to following the steps
below.

If you'd like to contribute to Firebase Simple Login, you'll need to run the following commands
to get your environment set up:

$ git clone https://github.com/firebase/firebase-simple-login.git
$ cd firebase-simple-login           # go to the firebase-simple-login directory
$ git submodule update --init lib/   # update the Google Closure library submodule
$ npm install -g grunt-cli           # globally install gulp task runner
$ npm install -g bower               # globally install Bower package manager
$ npm install -g phantomjs           # globally install PhantomJS test framework
$ npm install -g casperjs            # globally install CasperJS test framework
$ npm install                        # install local npm build / test dependencies
$ bower install                      # install local JavaScript dependencies

The source files are located at /js/src/simple-login/. Once you've made a change in one of
those files, run grunt build to generate the distribution files - firebase-simple-login.js
and firebase-simple-login-debug.js - which are written to the root directory.

You can run the test suite via the command line by running grunt test. This will run both
the Jasmine and Casper test suites. If you just want to run one, use grunt test:jasmine or
grunt test:casper.

You can also run the Jasmine test suite from within the browser. You first need to spin up a
local server:

$ python -m SimpleHTTPServer 7070

Then, navigate to http://localhost:7070/js/test/jasmine/index.html and the test suite will
start automatically.

主要指标

概览
名称与所有者googlearchive/firebase-simple-login
主编程语言JavaScript
编程语言JavaScript (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2013-02-11 22:11:47
推送于2018-08-24 22:15:42
最后一次提交2018-08-24 15:15:41
发布数21
最新版本名称v1.6.4 (发布于 )
第一版名称v1.0.1 (发布于 2014-01-06 11:21:54)
用户参与
星数151
关注者数59
派生数87
提交数191
已启用问题?
问题数0
打开的问题数0
拉请求数29
打开的拉请求数1
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?