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?
Facebook Attribute Mapping with StormPath to retrieve the Facebook ID
99 Views Asked by user992731 At
2


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_profileis the scope that contains the user ID. So, I went to my Facebook Directory, and under 'Provider Configuration' on the 'Scopes' tab, I addedpublic_profile. Under the 'Attribute Mappings' tab, I addedidas the Attribute Name and setcustomData.idas 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:
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:
web.me.expand.customDataconfig is set to true in order to have the custom data fields populated,name="customData.id", like this:This is covered in the docs under the Access custom data fields by prefixing field names with customData section.