https://supertokens.com/ logo
Title
c

CheezGarlick

12/20/2022, 9:09 AM
The third party provider google seems to be missing from the backend configs. If it is configured, then please make sure that you are passing the correct clientId from the frontend. Getting this error even though I have the client id in my providers on the backend...any possible steps I'm overlooking?
n

nkshah2

12/20/2022, 9:10 AM
Hi
Can I see the backend config?
c

CheezGarlick

12/20/2022, 9:21 AM
hello, that was an error on my end, I am now getting this error Provider API returned response with status
401 Unauthorized
and body `{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED" } } here is my body that I'm sending code: googleResponse.code, clientId: 'MYCLIENTID', thirdPartyId: 'google', redirectURI: 'https://directory.tryamigo.com/auth/callback/google',
n

nkshah2

12/20/2022, 9:22 AM
Which api is this?
c

CheezGarlick

12/20/2022, 9:23 AM
signinup
n

nkshah2

12/20/2022, 9:23 AM
Ah right, so looks like google threw an error
Is this a web client that you’ve set up with google?
The Oauth client I mean
c

CheezGarlick

12/20/2022, 9:24 AM
actually I got authcode from google just fine, getting this when sending that to signinup
yes it's a web client
n

nkshah2

12/20/2022, 9:26 AM
Looks like google isn’t expecting to use the code grant flow, can you try using the access token flow instead and see if that works?
So you want to get the id_token and access_token from google and then call the sign in up API with
authCodeResponse: {
  access_token
  id_token
}
Instead of
code
c

CheezGarlick

12/20/2022, 9:27 AM
okay, trying that
it seems like I can only get either code or accesstoken, not id token... https://developers.google.com/identity/oauth2/web/guides/use-token-model I'm following this guide
n

nkshah2

12/20/2022, 9:38 AM
Try sending only the access token, if the API returns 400 you can try sending the id token as an empty string
c

CheezGarlick

12/20/2022, 9:40 AM
this works (the empty string solution), thanks a lot
n

nkshah2

12/20/2022, 9:40 AM
Happy to help