nik2208.2208
01/03/2024, 10:32 PMnik2208.2208
01/03/2024, 10:34 PMbash
[Nest] 49152 - 01/03/2024, 11:30:23 PM ERROR [ExceptionsHandler] Received response with status 401 and body {
"error": "unauthorized_client",
"error_description": "Unauthorized"
}
Error: Received response with status 401 and body {
"error": "unauthorized_client",
"error_description": "Unauthorized"
}
at Object.exchangeAuthCodeForOAuthTokens (/Users/nicola/Devel/temp/test-nest-app/node_modules/supertokens-node/lib/build/recipe/thirdparty/providers/custom.js:259:23)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.signInUpPOST (/Users/nicola/Devel/temp/test-nest-app/node_modules/supertokens-node/lib/build/recipe/thirdparty/api/implementation.js:26:36)
at async Object.signInUpAPI [as default] (/Users/nicola/Devel/temp/test-nest-app/node_modules/supertokens-node/lib/build/recipe/thirdparty/api/signinup.js:68:18)
at async Recipe.handleAPIRequest (/Users/nicola/Devel/temp/test-nest-app/node_modules/supertokens-node/lib/build/recipe/thirdparty/recipe.js:73:24)
at async Recipe.handleAPIRequest (/Users/nicola/Devel/temp/test-nest-app/node_modules/supertokens-node/lib/build/recipe/thirdpartyemailpassword/recipe.js:63:24)
at async SuperTokens.middleware (/Users/nicola/Devel/temp/test-nest-app/node_modules/supertokens-node/lib/build/supertokens.js:195:38)
at async AuthMiddleware.supertokensMiddleware (/Users/nicola/Devel/temp/test-nest-app/node_modules/supertokens-node/lib/build/framework/express/framework.js:128:28)
at async /Users/nicola/Devel/temp/test-nest-app/node_modules/@nestjs/core/router/router-proxy.js:9:17
I can correctly login on prebuilt ui but there's something weird going on on mobile.rp_st
01/04/2024, 4:55 AMnik2208.2208
01/04/2024, 8:31 AMnik2208.2208
01/04/2024, 8:33 AMnik2208.2208
01/04/2024, 8:35 AMnik2208.2208
01/04/2024, 8:52 AMnik2208.2208
01/04/2024, 9:03 AMrp_st
01/04/2024, 9:11 AMrp_st
01/04/2024, 9:11 AMnik2208.2208
01/04/2024, 1:19 PMdart
if (Platform.isAndroid) {
googleSignIn = GoogleSignIn(
serverClientId: "GOOGLE_WEB_CLIENT_ID",
scopes: [
'email',
],
);
} else {
googleSignIn = GoogleSignIn(
clientId: "GOOGLE_IOS_CLIENT_ID",
serverClientId: "GOOGLE_WEB_CLIENT_ID",
scopes: [
'email',
],
);
}
why does apple (or not android actually, it is not clear if the counterparts are android and apple or the particular case is only android and all other follow the else statement) need both `clientID`and serverClientId
?rp_st
01/04/2024, 1:53 PMnik2208.2208
01/04/2024, 2:29 PMclientid
(in the google console the oauth code must be configured as web and not as android oath code) while apple needs both clientid
(retrieved from an ios oauth credential created in the console) and serverclientid
as per android? this is just to undestand the flownik2208.2208
01/04/2024, 2:33 PMdart
googleSignIn = GoogleSignIn(
clientId:
"GOOGLE_IOS_CLIENT_ID",
serverClientId:
"GOOGLE_IOS_CLIENT_ID",
scopes: [
'email',
],
);
on any other configuration the login call to supertokens backend fails with
bash
[Nest] 49152 - 01/03/2024, 11:30:23 PM ERROR [ExceptionsHandler] Received response with status 401 and body {
"error": "unauthorized_client",
"error_description": "Unauthorized"
}
as reported earlierrp_st
01/04/2024, 2:35 PMrp_st
01/04/2024, 2:36 PMrp_st
01/04/2024, 2:37 PMnik2208.2208
01/04/2024, 2:58 PMrp_st
01/04/2024, 3:00 PMrp_st
01/04/2024, 3:00 PMrp_st
01/04/2024, 3:00 PMrp_st
01/04/2024, 3:00 PMnik2208.2208
01/04/2024, 3:01 PMrp_st
01/04/2024, 3:01 PMrp_st
01/04/2024, 3:02 PMsigninup
API?nik2208.2208
01/04/2024, 3:02 PMnik2208.2208
01/04/2024, 3:02 PMnik2208.2208
01/04/2024, 3:03 PMrp_st
01/04/2024, 3:03 PMrp_st
01/04/2024, 3:03 PMrp_st
01/04/2024, 3:03 PMnik2208.2208
01/04/2024, 3:04 PMnik2208.2208
01/04/2024, 3:05 PMbash
curl --location --request POST 'http://localhost:3001/auth/signinup' \
--header 'rid: thirdpartyemailpassword' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
"thirdPartyId": "google",
"clientType": "...",
"redirecURIInfo": {
"redirectURIOnProviderDashboard": "",
"redirectURIQueryParams": {
"code": "...",
}
}
}'
rp_st
01/04/2024, 3:05 PMnik2208.2208
01/04/2024, 3:06 PMredirecURIInfo
instead of redirectURIInfo
rp_st
01/04/2024, 3:06 PMrp_st
01/04/2024, 3:06 PMnik2208.2208
01/04/2024, 3:09 PM