googleworkspace / php-samples

PHP samples for Google Workspace APIs
Apache License 2.0
288 stars 348 forks source link

Handle missing refresh tokens in the quickstarts #23

Closed erickoledadevrel closed 6 years ago

erickoledadevrel commented 6 years ago

Significant changes to the logic around handling access tokens. Ensures that fetchAccessTokenWithRefreshToken() is only called when a refresh token is present, and falls back to requesting a new token when one isn't. Sets the prompt OAuth2 parameter to ensure that the user sees the select account and consent screens, to ensure a refresh token is returned.

Prototyping on the Calendar quickstart, and will replicate out to the others once approved.

Fixes #16.

grant commented 6 years ago

@erickoledadevrel Let's follow up on this.

erickoledadevrel commented 6 years ago

Updated the rest of the quickstarts, tested them each by hand. Made some small fixes to the Apps Script quickstart, since the curly braces in the strings were being interpreted as variables.