Reputation: 6836
There are Parse user objects created through siging up with Facebook. How can I retrive the Facebook ID from these user objects?
As you can see the Parse User object has Facebook ID in the authData field.
Upvotes: 2
Views: 724
Reputation: 1434
You need to call Parse.Cloud.useMasterKey()
before accessing authData
.
Parse.Cloud.useMasterKey();
new Parse.Query(Parse.User).get(objectId).then(function(user) {
var authData = user.get("authData");
console.log(authData.facebook.id);
}
For more example, you can visit https://loginexample.parseapp.com/ which I built one month ago.
Upvotes: 2