Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh tokens are not returned by 0Auth2 client #52

Closed
nwaltham opened this issue Jun 12, 2013 · 1 comment
Closed

Refresh tokens are not returned by 0Auth2 client #52

nwaltham opened this issue Jun 12, 2013 · 1 comment
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@nwaltham
Copy link

Making a request using the following

var url = oauth2Client.generateAuthUrl({
    access_type : 'offline',
    scope : ['https://www.googleapis.com/auth/analytics.readonly https://www.googleapis.com/auth/analytics']
});

And in the call back:

  oauth2Client.getToken(code, function(err, tokens) {

results in a "tokens" object that does not have a refresh_token

@rakyll
Copy link
Contributor

rakyll commented Jun 17, 2013

Refresh tokens are returned on the first exchange, you need to persist them permanently. The latter exchanges will only return an access token. In order to receive a new refresh token, revoke user's existing access token and go through the auth flow again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants