ionic-oauth

OAuth based authentication for Ionic Apps


Install
bower install ionic-oauth

Documentation

Ionic-OAuth

OAuth based authentication for Ionic Apps

"hellofacebook" is an angular service provideded by Ionic-OAuth. This service provides two methods "login" and "logout" for facebook in our application.

#Install ###Bower Package

bower install ionic-oauth;

This command installs ionic-oauth along with hellojs ( http://adodson.com/hello.js ).

#Setup

#usage

var app = angular.module('sampleapp',[ 'sociallogin'  ]);
function sampleCtrl( $scope , hellofacebook  ){

  $scope.socialLogin = function( network ){ 
         sociallogin.login(network).then(function(data){
           // success callback
         },function(err){
           // failure callback
         })

 $scope.facebooklogout = function(){
    sociallogin.logout( network );
  }

}

#REST method 'sociallogin.login()' tries to login facebook and get the user profile. With the userprofile the method calls our REST method of application API.

Example REST method for express application :

 app.post("/sociallogin",function( req , res ){
      // crete the user with retrieved user profile
      //create jwt token with _id of created user , send the token to the client
 });