-
Notifications
You must be signed in to change notification settings - Fork 383
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
chore: docs and samples for refresh token, update uris #215
Conversation
console.log(`Refresh Token: ${oAuth2Client.credentials.refresh_token}`); | ||
console.log(`Expiration: ${oAuth2Client.credentials.expiry_date}`); | ||
console.log('Refreshing access token ...'); | ||
const res = await oAuth2Client.refreshAccessToken(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
README.md
Outdated
}); | ||
``` | ||
|
||
If a refresh_token is set again on `OAuth2Client.credentials.refresh_token`, you can cann `refreshAccessToken()`: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/auth/oauth2client.ts
Outdated
/** | ||
* Recommended. Indicates whether your application can refresh access tokens | ||
* when the user is not present at the browser. Valid parameter values are | ||
* online, which is the default value, and offline. Set the value to offline |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/auth/oauth2client.ts
Outdated
access_type?: string; | ||
|
||
/** | ||
* The response_type will always be set to CODE. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/auth/oauth2client.ts
Outdated
/** | ||
* Required. The client ID for your application. You can find this value in | ||
* the API Console. | ||
*/ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* Start by acquiring a pre-authenticated oAuth2 client. | ||
*/ | ||
async function main() { | ||
try { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
/** | ||
* The base endpoint for token retrieval. | ||
*/ | ||
private static readonly GOOGLE_OAUTH2_TOKEN_URL_ = | ||
'https://accounts.google.com/o/oauth2/token'; | ||
'https://www.googleapis.com/oauth2/v4/token'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Note: This is a semver minor change (though it will be included in the 1.0 release). I have no reason to believe it breaks any functionality, but it does (I think) bring us up to date with the most recent documentation: It's also suggested in #120 that this is causing problems for users as well. I will update the PR and commit message to call these both out. |
Note: This is a semver minor change (though it will be included in the 1.0 release). I have no reason to believe it breaks any functionality, but it does (I think) bring us up to date with the most recent documentation: https://developers.google.com/identity/protocols/OAuth2InstalledApp It's also suggested in #120 that this is causing problems for users as well.
Note: This is a semver minor change (though it will be included in the 1.0 release). I have no reason to believe it breaks any functionality, but it does (I think) bring us up to date with the most recent documentation: https://developers.google.com/identity/protocols/OAuth2InstalledApp It's also suggested in #120 that this is causing problems for users as well.
Addresses #111