Missing accessToken on native device
See original GitHub issueconst user = await GoogleAuth.signIn();
Ionic 5 Capacitor 3
If I testing this on web all working fine, but if I am on native device (in my case android) user.authentication
object has missing accessToken field. There is only idToken
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
React Native, unable to get access token - Stack Overflow
I'm using react-native-app-auth to get access token from azure ad b2c but I'm facing issues in android and in IOS in android it's...
Read more >Retrieve an Access Token and Refresh Token
The Device Token Request implements section 3.4 of the OAuth 2.0 Device Flow ... the error {"error_description":"The request is missing a required parameter...
Read more >Unable to login due to missing access token parameter for ...
The app is on the SF Mobile SDK 9.2.1 and it is only happening on iOS. The odd thing is that it seems...
Read more >OAuth 2.0 for Mobile & Desktop Apps - Google Developers
Obtaining OAuth 2.0 access tokens ... Installed apps are distributed to individual devices, and it is assumed that these apps cannot keep ...
Read more >Get access token with no human interaction - Cisco Community
1. You can create an Integration which will then allow you to create an OAuth Access token. There is a mandatory requirement to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks to the steps from @Mersal-Mohamed, the following code solves the problem
From the guide,
redirect_uri
must be set like that for “installed apps”. UsefirstValueFrom
iftoPromise
is deprecated.google has an end point which return access_token if you give it serverAuthCode
you can get server auth code through the ordinary request which you made by await GoogleAuth.signIn().
this is the end point link https://oauth2.googleapis.com/token
it’s post request which should have this body const body =
client_id=yourclientid&client_secret=yourclientsecret&code=serverAuthCode&grant_type=authorization_code&redirect_uri=${redirect_uri}
;redirect uri you can get it through these steps : go to https://console.cloud.google.com/ open your project credentials page click on android which under OAuth 2.0 Client IDs download json from android client page you will find redirect uri inside it
response of this request contain ACCESS_TOKEN which you could use it in your sign in process