Facebook Attribute Mapping with StormPath to retrieve the Facebook ID - facebook

This is driving me cray. I am trying to retrieve the Facebook id after logging in. I am assuming I have to use the attribute mapping in order to achieve this? Any thoughts?

Heyo, Just thought I'd reply here too in case anyone else has questions about this.
I looked at the Facebook scopes reference page, and it says that public_profile is the scope that contains the user ID. So, I went to my Facebook Directory, and under 'Provider Configuration' on the 'Scopes' tab, I added public_profile. Under the 'Attribute Mappings' tab, I added id as the Attribute Name and set customData.id as the 'Stormpath Field Name'.
When users log in to my web app using their Facebook credentials, their ID is saved directly to their account's customData:
{
"id": "1260737122323"
}
To grab this data from the Account's customData and display it on the profile page of the React-Express sample project, you need to do two things:
Ensure that the web.me.expand.customData config is set to true in order to have the custom data fields populated,
Add a new field on the profile page with name="customData.id", like this:
This is covered in the docs under the Access custom data fields by prefixing field names with customData section.

The documentation of these Facebook scopes is a little confusing, the properties on "public_profile" are actually available on the root of the Facebook user object, so in Stormpath you want to map id to customData.public_profile.id.

Related

Facebook Api search users by name returning empty data

I used this url with access token https://graph.facebook.com/search?q=Marcus&type=user&access_token= and it returns empty data data []
Settings https://i.imgur.com/6hEiO5y.png
I was trying to get a list of users with their name using javascript. Is it possible ?
as mentioned in the comments here is the official Facebook note, that you cannot search for type = user anymore:
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
The /search endpoint for pages, videos, groups and events has been disabled by facebook after the cambridge analytica scandal.
Faceboook Changelog:
You can no longer use the /search endpoint with the following object types:
event
group
page
user

Ionic with Backand social login: profile picture

I'm developing an application with ionic and Backand and I'm using the sign in with social accounts with the Backand service.
The social login process is OK, but I want to get the ID from Facebook and Google plus in order to get the profile picture.
I was talking with the support of Backand and I know that in Security and Auth there is an action "beforesocialSignUp" and I have not commented the line to get the data:
'use strict';
function backandCallback(userInput, dbRow, parameters, userProfile) {
// get facebook id and put in fuid field that you need to add to your user object
userInput.fuid = parameters.socialProfile.additionalValues.id;
// get gender from facebook and put in gender field that you need to add to your user object
// userInput.gender = parameters.socialProfile.additionalValues.gender;
}
And I have created the fuid field in my user object, but, when I make a login with Facebook or Google+ It doesn't save nothing. The login is OK but I can't get the ID data.
Any idea?
I had exactly the same problem.
The solution was to set the where condition of the BeforeSocialSignUp function from false to true.
This is nowhere in the documentation explained.
It took me 3 day ro figure this out :-(
Now the login works as expected and the fuid field gets assigned.
My next step is to get the profile picture from the FB Account, but therefore I have to make an API request to facebook with a user access token which I dont know how to get from backand.

Not able to retrieve gender in google plus ios sdk

I used GTLQueryPlus.queryForPeopleGetWithUserId("me") for retrieving logged in user information. I am not getting the gender in json. When I set the gender visibility to 'public' instead of 'my circles' from my google plus profile, then I got the gender.
How to get the gender info without changing the settings from googe plus profile settings?
scopes used: signIn.scopes = [kGTLAuthScopePlusMe, kGTLAuthScopePlusUserinfoProfile, kGTLAuthScopePlusLogin];
You can only access what a user has set to public. If the user doesn't want this information public then you cant have the information.
Just because I authenticate your application doesn't mean that I want you to for example to see my address or in this case my gender. So I don't set them public you cant see them.

Cannot find realtime updates panel in the new App DashBoard

Where can we configure "Subscribing to Realtime Updates" in the new App Dashboard ?
It looks like the following documentation is not aligned with the new App dashboard
https://developers.facebook.com/docs/graph-api/real-time-updates
thanks
Payments and Payment subscriptions objects are appears in "Orders" tab: https://developers.facebook.com/x/apps/__appId__/payments/
But you can't configure actions field (oO)
For configure those fields and other objects, use Graph API.
For example, graph api explorer https://developers.facebook.com/tools/explorer
set type to POST
remove access_token input's value
set url __appID__/subscriptions?access_token=__appID__|__appSecret__&object=payments
add field:
object: (subscription object - user, payments, permissions, etc)
callback_url: your_url
verify_token: your_token
fields: (for payments actions,disputes are required)
Update: found, that this, old URL is still work:
https://developers.facebook.com/apps/__appID__/realtime?ref=nav

Exclude permissions from Facebook API

Apparently when calling FB.login, the default permissions the user will have to give is this:
"xxx will receive the following info: your public profile and friend list".
And I know that I can add extra permissions with: { scope : 'email' } and so on.
The problem is, I don't want the whole public profile and the friend list.
The only thing I want is: first name, last name and email.
Is it possible to exclude the basic permissions and just have the ones I want?
No, not possible.
https://developers.facebook.com/docs/facebook-login/permissions/:
“When someone connects with an app using Facebook Login, the app can access their public profile and friend list, the pieces of information that are visible to everyone. ”