Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OauthButton: How do I set access_type = offline?

I would like to develop an application to display the contents of Gmail inbox.
However, refresh_token does not exist even after checking onAccessToken.

 

I would like to set access_type = offline to get refresh_token,
What should I do?

 

 

<Oauth
settingsKey="oauth" title="Gmail Login" label="Gmail" status="Login" authorizeUrl="https://accounts.google.com/o/oauth2/v2/auth" requestTokenUrl="https://www.googleapis.com/oauth2/v4/token" clientId="XXXXXXXXXXXXXXXXXX" clientSecret="XXXXXXXXXXXXX" scope="https://www.googleapis.com/auth/gmail.readonly" onAccessToken={async (data) => { console.log(data); }}
/>


 

 

Best Answer
0 Votes
3 REPLIES 3

I would like an answer to this question too. Even with pkce set to true it does not return a refresh token.

Best Answer
0 Votes

You can try adding "offline_access" to the scope.

 

scope="offline_access, https://www.googleapis.com/auth/gmail.readonly

NOTE:

I am currently experimenting some issues on authentication using iOS (on Android is working fine)
3rd-party-REST-API-OAuth-authentication

Best Answer
0 Votes

That didn't work for me, it returns with an error "invalid scope"

Best Answer