Cannot retrieve access_token (updated)
See original GitHub issueHi, when I use web, the answer comes in the format:
{ id: string; email: string; name: string; familyName: string; givenName: string; imageUrl: string; serverAuthCode: string; authentication: { accessToken: string; idToken: string; }; }
and I can get accessToken, but when I use this implementation on android, the answer comes in a different format:
{ id: string; email: string; name: string; familyName: string; givenName: string; imageUrl: string; idToken: string; serverAuthCode: string; authentication: { idToken: string; }; }
we get idToken 2 times and there is no accessToken field.
How do I get accessToken? Maybe there is another way
Thank you, Alexandr
_Originally posted by @Alexandr-Pivovar in https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/32#issuecomment-638057611_
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top GitHub Comments
the accessToken is missing in the native code https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/5d2165d0856328891f48c5c6fe383541f42edb1b/android/src/main/java/com/codetrixstudio/capacitor/GoogleAuth/GoogleAuth.java#L80
web code contains accessToken: https://github.com/CodetrixStudio/CapacitorGoogleAuth/blob/5d2165d0856328891f48c5c6fe383541f42edb1b/src/web.ts#L114
but the GoogleSignInAccount, don’t have accessToken. https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInAccount
I’m making the same call as you through postman and on my local client, I seem to be getting this error:
I think that it could be the token being invalid, is there any setting you changed for your client to allow this API call to go through?