Closed victorhaggqvist closed 9 years ago
How interesting. gaps stores a local config in ~/.gaps
. Can you check this file to see if there is a refresh_token property there? If not, can you try delete the file and run gaps init
again?
My bad, missed the notification of your reply.
There seem to be no refresh_token
.
Tried once again today, no luck.
$ cat ~/.gaps
{
"client_id": "360000004155-vc7kl330k14upfnp8ogir69mf8kl0fjm.apps.googleusercontent.com",
"client_secret": "UcP5-Lj6SwfwffwefwewfeMqAWHsWg",
"redirect_uri": "https://www.example.com/oauth2callback"
}
Hello,
I have the same issue, but on my side I managed to track it down: as stated here https://developers.google.com/identity/protocols/OAuth2WebServer - when access_type="offline", "This will result in your application obtaining a refresh token the first time your application exchanges an authorization code for a user.".
As the refresh token is passed only first time, I assume this is the second time you have run the the init on the same URL, so refresh token was not passed anymore
To fix this, I would suggest adding in the init.js, the "approval_prompt": 'force' parameter as well (http://stackoverflow.com/questions/8942340/get-refresh-token-google-api). As per above link: " If the value is force, then the user sees a consent page even if they previously gave consent to your application for a given set of scopes."
var url = oauth2Client.generateAuthUrl({ access_type: 'offline', // Required to receive a refresh token scope: GOOGLE_AUTH_SCOPE, approval_prompt: 'force' });
Thanks, Ado
Great find @szaboadorian, I had totally forgotten about the approval_prompt
property. I'll fix this in the next patch
@victorhaggqvist can you confirm this works?
I'm on Arch Linux with $ node --version && npm --version v0.12.3 2.10.0
Let me know if I can provide any more info to help out.