Google-api-nodejs-client: support `approval_prompt: force` to get new `refresh_token`

Created on 25 Dec 2013  Â·  1Comment  Â·  Source: googleapis/google-api-nodejs-client

It would be awesome if this were supported:

Important: When your application receives a refresh token, it is important to store that refresh token for future use. If your application loses the refresh token, it will have to re-prompt the user for consent before obtaining another refresh token. If you need to re-prompt the user for consent, include the approval_prompt parameter in the authorization code request, and set the value to force.
— https://developers.google.com/accounts/docs/OAuth2WebServer#offline

triage me

Most helpful comment

This can be achieved like so:

  // generate consent page url
  var url = oauth2Client.generateAuthUrl({
    access_type: 'offline', // will return a refresh token
    scope: 'https://www.googleapis.com/auth/calendar',
    approval_prompt: 'force'
  });

>All comments

This can be achieved like so:

  // generate consent page url
  var url = oauth2Client.generateAuthUrl({
    access_type: 'offline', // will return a refresh token
    scope: 'https://www.googleapis.com/auth/calendar',
    approval_prompt: 'force'
  });
Was this page helpful?
0 / 5 - 0 ratings

Related issues

streamnsight picture streamnsight  Â·  4Comments

skiod picture skiod  Â·  3Comments

ACMerriman picture ACMerriman  Â·  3Comments

peterpme picture peterpme  Â·  3Comments

Chethandsagar picture Chethandsagar  Â·  4Comments