CordovaAouth facebook returning only access token


#1

Hi, am currently login user using ngcordovaOauth by nicraboy ,
this is the controller

$scope.login = function() {
$cordovaOauth.facebook("*******************", ["email"]).then(function(result){
    $rootScope.facebook= result;
   	$state.go('app.partylists');
}, function(error){
  alert("Error : " + error);
});
};

it returns only access token , how do i get the username , profile picture, gender email …


#2

ngCordova Oauth plugin is only authorization plugin, you can’t use it to access client personal data.


#3

thanks , guess only option firebase , but hoping to use it with hacker plan as am only using for auth - is this good plan


#4

Hi madiba,

In the [“email”] field , which email we have to give in order to get the access token

Thankyou


#5

http://www.clearlyinnovative.com/ionic-framework-facebook-login-with-parse

see blog post it is about integrating with Parse with $cordovaFacebook, but I show how to get additional user information from facebook using $cordovaFacebook.api

// STEP - 4 GET ADDITIONAL USER INFORMATION FROM FACEBOOK
// get the user information to add to the Parse Object
var fbValues = "&fields=id,name,location,website,picture,email";
var fbPermission = ["public_profile"];

return $cordovaFacebook.api("me?access_token=" + accessToken + fbValues, fbPermission);

#6

@karkhik , i just passed the email as you see , i assume it the requesting for fields from facebook , as in the get me the email feed ,


#7

@madibaion, thankyou for you answer… It worked…


#8

@karthik123 Hi ,am using this library it super easy , has support for in app browser and and native app if its installed ,also has a google aouth which is awesome for android apps , it return all the data i need ,
ionic oath github


#9

@madibaion . sorry for late reply… Thankyou…I’ll take look at it .