Hey <@498057949541826571> , need ur help in social logins at backend this is my config for google `...
a
Hey @rp_st , need ur help in social logins at backend this is my config for google
Copy code
config: {
          thirdPartyId: THIRD_PARTY.GOOGLE,
          clients: [
            {
              clientId: process.env.GOOGLE_CLIENT_ID,
              clientSecret: process.env.GOOGLE_CLIENT_SECRET,
              clientType: CLIENT_TYPE.WEB,
            },
            {
              clientId: process.env.IOS_GOOGLE_CLIENT_ID,
              clientType: CLIENT_TYPE.IOS,
            },
            {
              clientId: process.env.ANDROID_GOOGLE_CLIENT_ID,
              clientType: CLIENT_TYPE.ANDROID,
            },
          ],
        },
from frontend i am calling the api
Copy code
curl -X 'POST' \
  'http://localhost:3001/auth/signinup' \
  -H 'accept: application/json' \
  -H 'rid: thirdpartypasswordless' \
  -H 'Content-Type: application/json' \
  -d '{
  "thirdPartyId": "google",
  "clientType": "ios",
  "redirectURIInfo": {
    "redirectURIOnProviderDashboard": "",
    "redirectURIQueryParams": {
      "code": "4/0AeaYSHB4c8QnHY7fjQS0K8j169tLw6ONPV-5-JB7HfQ6tsa6Jq0GHyu0VDAz53L5LdYUZQ"
    }
  }
}'
but always getting error such as
Copy code
Error: Received response with status 400 and body {
  "error": "invalid_grant",
  "error_description": "Bad Request"
}
    at Object.exchangeAuthCodeForOAuthTokens (C:\Users\Ankit Gupta\Desktop\dh\dh-prajavani-auth\api\node_modules\supertokens-node\lib\build\recipe\thirdparty\providers\custom.js:259:23)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.signInUpPOST (C:\Users\Ankit Gupta\Desktop\dh\dh-prajavani-auth\api\node_modules\supertokens-node\lib\build\recipe\thirdparty\api\implementation.js:26:36)
please help me out
r
hey @anurag06557 this usually means you have given the wrong client id / secret or the callback url configured on the provider's dashboard is wrong
a
but in ios we dont have any callback url ?
also do we have the clinet_secret separately for ios? we are not using the client_secret for ios. do u want us to use the same as that if web?
i have consoled inside dist the actual params that are getting passed so i get this
Copy code
{ tokenAPIURL: 'https://oauth2.googleapis.com/token' } {
  accessTokenAPIParams: {
    client_id: '997955211260-4f17j7s4d5j935joiutqruntp6bc9ase.apps.googleusercontent.com',
    redirect_uri: '',
    code: '4/0AeaYSHDNib3uZC7vw58wEeR0DuOft-afqvEECQ1GNPd8NlQFuwSWcZ0fNoNeh6lZn8lkAw',
    grant_type: 'authorization_code'
  }
}
is there any issue with the tokenAPIURL? or grant_type
r
see our guide / examples for ios integration please. Your questions are quite vague to help out here. Sorry
a
already refred those guides, but was not able to resolve the issue
r
which framework are you using?
as in swift / react native / flutter?
9 Views