Hey there, <@498057949541826571> I'm currently i...
# general
a
Hey there, @rp_st I'm currently integrating social authentication (google) into my application via SuperTokens. I'm looking to retrieve additional user details such as first name, last name, and gender from the social authentication process. However, it seems that these details are not being populated in the user data. as these are basic user details that must provided by google or any other social auth. Could you please let me know if there's any extra configuration required in the SuperTokens config to fetch these details, or if it's outside the scope of SuperTokens?
r
hey @ashutoshdeshmukh.22 you need to add the right set of scopes to the social login provider
a
Thanks @rp_st It Works
HI @rp_st I am unable to retrieve first and last names and other info from Apple despite specifying the proper scopes. However, I am able to retrieve user info from Google. can you help here in case of Google, user information is obtained in the
rawUserInfoFromProvider
object, but not in the case of Apple. The
fromUserInfoAPI
object is empty, and the
fromIdTokenPayload
object contains other information such as email, aud, and iss, but not the name.
r
What scope have you given for Apple?
a
scope: ['name email'],
r
Can you show me the full Apple config you have given?
To our backend
a
sure @rp_st
Copy code
{
      clientId: process.env.APPLE_CLIENT_ID,
      clientType: CLIENT_TYPE.WEB,
      additionalConfig: {
        keyId: process.env.APPLE_KEY_ID,
        privateKey: process.env.APPLE_PRIVATE_KEY,
        teamId: process.env.APPLE_TEAM_ID,
      },
      scope: ['name email'],
},
r
Make it scope: [“name”, “email”]
a
After adding scope in above format still i'm not getting name field
in either fromUserInfoAPI or fromIdTokenPayload
r
Can you try with a different Apple login email id?
a
I have tried, but still not able to get 🥲
r
Maybe the scopes you are using aren’t correct.
I’ll have to check later when I’m free.
a
sure @rp_st
r
hey @ashutoshdeshmukh.22 are you using web login or mobile app login?
a
Hey @rp_st It's working now As per Apple documentation, you cannot get the name or email again by doing the same auth process again on the same or any other device unless the user stops using Sign in with Apple for your app and later reconnects to your app. Even then you will only get it for the very first time. Maybe for the first time, I missed it 😅 Thanks. 🙂
HI @rp_st I have a question regarding Google login. When we use a normal Google login, we receive an access token, refresh token, ID token, scope, and other related information in the response. However, when we use One Tap, we only receive the ID token. Is there any way to receive the same response from Google as in a normal Google login, as I need the access token and refresh token to call another Google API (Google People API) to fetch gender and date of birth information? The standard response does not include date of birth and gender. If there is another way to get gender and date of birth without calling Google People API, please let me know.
r
@sattvikc , any thoughts here?
s
one moment, going thru
seems like there is no straight fwd way to get the access token with one tap. there is one work around described here - https://stackoverflow.com/questions/72612704/how-to-get-oauth-token-after-google-one-tap-sign-in-jwt-token-response-of-one-t
a
So @rp_st @sattvikc How can I call the Google People API to fetch gender and date of birth without access_token any inputs?
s
the stack overflow link describes how to get the access token
a
Thanks but, I'm trying to do so in config.ts file before storing metadata as I want to store these additional fields in metadata whatever solution is provided in StackOverflow does not align with my current node js implementation.
and the library used there is only for client-side not server-side @rp_st @sattvikc if you can help here its will be helpful guys
s
from what I am aware, there is no way to get access token using id token. and one tap login provides id token only unfortunately. you may need to use the default way of thirdparty login for your use case.
in the backend, you can override the signinup recipe function, where you will be able to get the access token from the provider. Using that, you should be able to call any of the google's APIs
I'll help you with an example (based on the solution offered in stackoverflow) tomorrow
a
Sure @sattvikc, It would be very helpful, Thanks
Hi @sattvikc @rp_st , Morning Bro, Any updates
s
@ashutoshdeshmukh.22 pls see if this helps
a
I tried it @sattvikc but its not working for me The callback is not being executed there and the overriding method is not being executed It is logging Id_token and payload in console but not access_token
s
backend console or browser console?
a
both @sattvikc I have added console log on both places
nothing is getting logged on backend
on browser console payload is logging
s
are u running the example i shared?
a
yes
s
could u share video of what's happening? also debug logs
a
can you tell me the example you shared is is working at your end
means is access_token getting logged on console
s
yes
shared with u only after testing it
a
Then i'm running the same code why i'm not able to, i have not done any changes in tha
s
it should work, let me know if you are unable to figure out
a
yes
10 Views