https://supertokens.com/ logo
#general
Title
# general
a

Ashish

05/26/2022, 11:31 AM
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

rp

05/26/2022, 11:31 AM
hey @Ashish
a

Ashish

05/26/2022, 11:32 AM
Hey @rp
r

rp

05/26/2022, 11:33 AM
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

Ashish

05/26/2022, 11:36 AM
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

Ashish

05/26/2022, 11:39 AM
Yes, the Linkedin signup is working fine now. May be I can raise a PR for that?
r

rp

05/26/2022, 11:39 AM
yea sure! that would be super helpful 🙂
a

Ashish

05/26/2022, 11:40 AM
Great! I will do that.
@rp I have the access token now using override.
Can I use this to update a meta?
r

rp

05/26/2022, 11:55 AM
yea. you can use this to get info from linkedin and then save that in the usermetadata
a

Ashish

05/26/2022, 11:56 AM
To save the usermetadata, I need to use updateUserMetadata()?
r

rp

05/26/2022, 11:57 AM
yes
a

Ashish

05/26/2022, 12:01 PM
Is there a way that I can update the third_party_user_id in override as well?
r

rp

05/26/2022, 12:02 PM
that should be the linkedin's user id of the user.
a

Ashish

05/26/2022, 12:02 PM
yes
that's right
r

rp

05/26/2022, 12:03 PM
WHat's your use case for overriding that?
a

Ashish

05/26/2022, 12:03 PM
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

rp

05/26/2022, 12:05 PM
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

Ashish

05/26/2022, 12:06 PM
Or, if I can pass the data from signInAndUpFeature to override, that would also work
r

rp

05/26/2022, 12:06 PM
in the custom provider configs
are you not setting third_party_user_id in your custom provider's implementation?
a

Ashish

05/26/2022, 12:06 PM
I am
r

rp

05/26/2022, 12:07 PM
right. So you want to change that later on?
a

Ashish

05/26/2022, 12:09 PM
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

rp

05/26/2022, 12:09 PM
hmm. So at the moment, it's not. You will have to query the other linkedin endpoint again in the override
a

Ashish

05/26/2022, 12:10 PM
Got it