Auth0 Home Blog Docs

User Name / Image / Sub etc for Custom Social Connection (Pinterest)


#1

Hi there,

I have a Custom Social Connection extension up and running but could really do with a pointer as to how to get the “standard” fields stored on the User meta for other social connections.

Is there any instructions about how to store this from the extension ?

Thanks.


#2

Hey there @NigelGodfrey, what does your current scope look like when trying to leverage stored fields? I also have linked some of the standard documentation when it comes to Custom Social Connections. Thank you in advance!



#4

So currently we have a rule for the various “built in” social platforms (twitter/linkedin/facebook in our case) that saves the oauth token(s) on the user.

However the auth0 standard user in these cases already has name/image/sub that we use throughout our app to identify the user’s platforms.

That all works really well, but I don’t know how to make this work with Custom Social connection to Pinterest. How do I create fields on the “user” from the Custom COnnection ?


#5

You can add set attributes in the user profile at the ‘Fetch User Profile Script’ code in the extension. For example, if you want to add an app_metadata attribute during login, add these two lines:

    profile.app_metadata = profile.app_metadata || {};
    profile.app_metadata.pqr = profile.avatar;

Here, pqr is the attribute name you need, and profile.avatar is its value - assuming the social identity provider sends an ‘avatar’ attribute in the user profile.