Logging in and displaying name(email) and nickname works fine, but I cannot display given_name or family_name. (I’ve also tried user_location and user_hometown)
In Auth0 dashboard under Social Connections, public_profile is ticked and cannot be unticked, but when I Try Connection profile/full name is not retrieved (nor location)
So it would seem to be a configuration issue within the Auth0 dashboard, rather than an application issue.
Thanks Dan, there is actually - just a quick follow up about verifying what gets saved to the primary identity. Is it possible to do that from the dashboard?
As I said, I can save given_name and family_name and retrieve those values in my application …
but I’d really like to be able to access location. I’ve ticked this under the facebook connection and can view this under the Raw Json for myself as a user.
However, I’ve tried a variety of ways to add this to the primary identity so that I can see this in my application just like given_name.
Here’s my latest attempt: I’ve put identities in the outer loop and have changed the dot notation to array accessor with a string literal (despite warnings when editing the rule, the dot notation does not work). When I Iog in, I can see the value in the debug logs
How can I verify that this is saved? I can’t see given_name in the dashboard although it must be as this is returned to my application.
Here’s my rule:
function(user, context, callback) {
const propertiesToComplete = ["given_name", "family_name"];
// go over each property and try to get missing
// information from secondary identities
for(var identity of user.identities) {
console.log(identity.provider);
if (identity.provider === "facebook" && identity.profileData && identity.profileData.hometown){
console.log("Hometown!", identity.profileData["hometown"]["name"]);
user["hometown"] = identity.profileData["hometown"]["name"];
}
for(var property of propertiesToComplete) {
// if (!user[property]) {
if (identity.profileData && identity.profileData[property]) {
user[property] = identity.profileData[property];
break;
}
// }
}
}
callback(null, user, context);
}