GithubHelp home page GithubHelp logo

thething / angularjs-social-login Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heresy/angularjs-social-login

0.0 2.0 1.0 24 KB

Simple social authentication module for AngularJS applications.

Home Page: https://github.com/heresy/angularjs-social-login

JavaScript 100.00%

angularjs-social-login's Introduction

AngularJS Social Login (socialLogin)

AngularJS Social Login Module is a simple client side authentication module which helps to authenticate your application using Google/Facebook/LinkedIN. It doesn't maintain any session, session between client application and server should be maintained by yourself after receiving user details from the provider.

Supported sites:

  • Google
  • Facebook
  • LinkedIN

Installation

via npm

npm install angularjs-social-login --save

via bower

bower install angularjs-social-login --save

configure installation

Include JS files:

<script src="bower_components/angularjs-social-login/angularjs-social-login.js"></script>

Then include socialLogin as a dependency for your app:

angular.module('myApp', ['socialLogin']);

Configuration

Example

app.config(function(socialProvider){
	socialProvider.setGoogleKey("YOUR GOOGLE CLIENT ID");
  socialProvider.setLinkedInKey("YOUR LINKEDIN CLIENT ID");
  socialProvider.setFbKey({appId: "YOUR FACEBOOK APP ID", apiVersion: "API VERSION"});
});

Usage

There are total three directives for handling Google, Facebook, LinkedIn authentication.

  • fbLogin (For Facebook)
  • gLogin (For Google)
  • linkedIn (For LinkedIn)

Methods

  • socialProvider.setGoogleKey("YOUR GOOGLE CLIENT ID")
  • socialProvider.setLinkedInKey("YOUR LINKEDIN CLIENT ID")
  • socialProvider.setFbKey("YOUR FACEBOOK APP ID")
  • $rootScope.$on('event:social-sign-in-success', function(event, userDetails){}) Braodcast event which will be triggered after successful authentication. userDetails is an Object consists of {name: <user_name>, email: <user_email>, imageUrl: <image_url>, uid: <UID by social vendor>, provider: <Google/Facebook/LinkedIN>, token: <Google ID token for google, accessToken for Facebook, no token for linkedIN>}
  • socialLoginService.logout() For logout
  • $rootScope.$on('event:social-sign-out-success', function(event, logoutStatus){}) Braodcast event which will be triggered after successful logout.

Example

<button g-login type="button">Google Login</button>
<button linked-in type="button">LinkedIn Login</button>
<button fb-login type="button">facebook Login</button>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.