Skip to content

Commit b933846

Browse files
Eric Koledasqrrrl
authored andcommitted
Update Google samples to latest OAuth endpoints (#189)
1 parent 50612b6 commit b933846

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

samples/CloudIdentityAwareProxy.gs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function getService() {
5454
return OAuth2.createService('CloudIAP')
5555
// Set the endpoint URLs.
5656
.setAuthorizationBaseUrl('https://accounts.google.com/o/oauth2/auth')
57-
.setTokenUrl('https://www.googleapis.com/oauth2/v4/token')
57+
.setTokenUrl('https://oauth2.googleapis.com/token')
5858

5959
// Set the client ID and secret.
6060
.setClientId(CLIENT_ID)

samples/Google.gs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ function reset() {
4141
function getService() {
4242
return OAuth2.createService('Google')
4343
// Set the endpoint URLs.
44-
.setAuthorizationBaseUrl('https://accounts.google.com/o/oauth2/auth')
45-
.setTokenUrl('https://accounts.google.com/o/oauth2/token')
44+
.setAuthorizationBaseUrl('https://accounts.google.com/o/oauth2/v2/auth')
45+
.setTokenUrl('https://oauth2.googleapis.com/token')
4646

4747
// Set the client ID and secret.
4848
.setClientId(CLIENT_ID)

samples/GoogleHangoutsChat.gs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function reset() {
6363
function getChatbotService() {
6464
return OAuth2.createService('MyChatBot')
6565
// Set the endpoint URL.
66-
.setTokenUrl('https://accounts.google.com/o/oauth2/token')
66+
.setTokenUrl('https://oauth2.googleapis.com/token')
6767

6868
// Set the private key and issuer.
6969
.setPrivateKey(PRIVATE_KEY)

samples/GoogleServiceAccount.gs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function reset() {
4444
function getService() {
4545
return OAuth2.createService('GoogleDrive:' + USER_EMAIL)
4646
// Set the endpoint URL.
47-
.setTokenUrl('https://accounts.google.com/o/oauth2/token')
47+
.setTokenUrl('https://oauth2.googleapis.com/token')
4848

4949
// Set the private key and issuer.
5050
.setPrivateKey(PRIVATE_KEY)

0 commit comments

Comments
 (0)