netlify-labs / oauth-example

Example of how to use Netlify OAuth Applications
https://oauth-example.netlify.com/
38 stars 18 forks source link

Getting a refresh_token issued #1

Closed ogazitt closed 4 years ago

ogazitt commented 4 years ago

Thanks for the excellent example! I've been trying to modify it to get a refresh_token in addition to the access_token. I tried modifying the scope parameter in auth_start.js:22 to 'offline_access' but that didn't seem to do the trick. Any advice would be greatly appreciated!

  const authorizationURI = oauth.authorizationCode.authorizeURL({
    redirect_uri: config.redirect_uri,
    /* Specify how your app needs to access the user’s account. */
    scope: 'offline_access',
    /* State helps mitigate CSRF attacks & Restore the previous state of your app */
    state: `url=${redirectUrl}&csrf=${csrfToken}`,
  })
ogazitt commented 4 years ago

From @DavidWells on the twitters:

Yeah just confirmed. OAuth tokens last forever until the user revokes the app

Closing the issue.