How to save additional user information using Thir...
# general
a
How to save additional user information using Thirdparty recipe? I am using Linkedin to sign up and want to save user image URL, first name and last name.
r
hey @Ashish
a
Hey @rp
r
so first, you need to fetch all the extra info from the social login provider using their access token
assuming you have done that, you can store that info against the user ID using our user metadata feature: https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/usermetadata/about
And you can add that in the post signInUp callback
(i assume that you are using thirdpartyemailpassword recipe)
a
I am using thirdparty only social login
Have you gotten linkedin sign up to work fully? We don't have that by default, so you have to add the logic for it yourself.
a
Yes, the Linkedin signup is working fine now. May be I can raise a PR for that?
r
yea sure! that would be super helpful 🙂
a
Great! I will do that.
@rp I have the access token now using override.
Can I use this to update a meta?
r
yea. you can use this to get info from linkedin and then save that in the usermetadata
a
To save the usermetadata, I need to use updateUserMetadata()?
r
yes
a
Is there a way that I can update the third_party_user_id in override as well?
r
that should be the linkedin's user id of the user.
a
yes
that's right
r
WHat's your use case for overriding that?
a
Linkedin gives User ID and email in 2 different APIs.
They have user_email and user_info endpoints
user_info has the ID and the user meta data. Either I have to call this endpoint twice, or I have figoure out if I can update third_party_user_id later
r
you can't update that later since we use that as part of the primary key for that user
so you need to set it when you are retuning the profile info
a
Or, if I can pass the data from signInAndUpFeature to override, that would also work
r
in the custom provider configs
are you not setting third_party_user_id in your custom provider's implementation?
a
I am
r
right. So you want to change that later on?
a
Okay, so here's what I want. I want to return additional user info from signInAndUpFeature and use that in override.
Is it possible?
r
hmm. So at the moment, it's not. You will have to query the other linkedin endpoint again in the override
a
Got it