I am trying to get access token & refresh token using OAuth.io for Google provider. I have chosen offline for the access_type in OAuth.io.
Following is the code
OAuth.popup("google", {'authorize' : { "approval_prompt" : 'force'}})
.done(function(result) {
console.log(result);
})
.fail(function (err) {
//handle error with err
console.log(err);
});
I am not receiving refresh_token in the response. I am getting only access_token from response.
JSON response for access token is:
{
"status": "success",
"data": {
"access_token": "ya29.pAGQWe3yxxxxxx",
"token_type": "Bearer",
"expires_in": 3600,
"request": {
"url": "https://www.googleapis.com",
"headers": {
"Authorization": "Bearer {{token}}"
}
},
"id_token": "eyJhbGciOiJSUzIxxxxxxxx"
},
"state": "Q9nfocQXJxxxx",
"provider": "google"
}
Reference
I have found this SO link Getting refresh tokens from Google with OAuth.io Here they have explained how to get refresh token in server side.
I want to get refresh token in client side JS.