Hi guys, so I'm implementing authentication for Re...
# support-questions-legacy
g
Hi guys, so I'm implementing authentication for React-Native (ios and android) for apple and google using Thirdpartypasswordless recipe. Apple works fine! but with google, it's returning me a serverAuthCode, which I'm sending as
code
in the /signinup endpoint, and I'm getting this error
r
hey @ggi_d can i see the request that you are making to the backend?
g
sure, just a sec
Copy code
data: {
                    code: googleRespose.serverAuthCode,
                    clientId: Platform.OS === 'ios' ? IOS_CLIENT_ID : ANDROID_CLIENT_ID,
                    thirdPartyId: 'google',
                    redirectURI: '/auth/callback/google',
                }
r
for google, you need to create an android app on their dashboard which you should use in react-native app
see this example
essentially, the above lib will give you the access token from google directly which you need to send to the backend
not the authCode
g
also we're not using the react-native sdk
r
thats fine. The above code snippet has nothing to do with the RN SDK that we have - excepting that if you did use our SDK, the session tokens would be handled for you
out of curiosity - why aren't you using our RN SDK?
g
Hi @rp_st , trying to find the reason for not usign the sdk, getting in touch with the app dev
Copy code
method: 'POST',
                url: '/auth/signinup',
                data: {
                    authCodeResponse: { id_token: tokens.idToken, access_token: tokens.accessToken },
                    clientId: Platform.OS === 'ios' ? IOS_CLIENT_ID : ANDROID_CLIENT_ID,
                    thirdPartyId: 'google',
                    redirectURI: 'com.amigo.metrics:/dashboard',
                }
but still getting the 401 response from google
r
Hmmm.
What scopes have you provided?
g
just the profile and email scopes
r
Hmmm
Perhaps @sattvikc2793 can help out tomorrow
g
also I think this error occurs when calling google apis to access some resource and send unauthenticated requests
r
Yea. Seems like it
@sattvikc will help out tomorrow
g
ccol
I think this piece of code is throwing the error
r
Hmmm. Maybe you can step through the code using a debugger and see if that’s true
g
yep
s
hey
g
Hi, sorry for being away. It was festival season, and I was away on a vacation. Had sorted out through a lot of issues that came up, most of them were configuration issues and all. But this issue still persists.
This is my request body, whenever I try logging into google using only the
code
method, i get a 401 unauth response from google and supertokens returns 500
r
whats the input to the signinup API?
g
this
r
hmmm.
@nkshah2 can help here
n
When you created your OAuth client on the google dashboard did you use the web type or android/ios?
g
this client id is web
n
Are you passing both the client id and secret when initialising Google on the backend?
g
yes
n
What flow are you using to login with Google? Since you mentioned you are not using the sdk
If you meant the SuperTokens SDK, are you using the official Google SDK for react native?
g
@AngelicDevil can answer this better
a
for our web flow, we are generating the code through oauth and then trying to make a signinup call using that code and clientId to make the relevant auth/signinup call
r
can we get on a call?
a
entering