3

revokeCredentials: Revokes access token and clears the credentials object

revokeToken: Revokes the access given to token.

What's the difference? There is no doc and sample for explaining these two methods here.

Lin Du
  • 88,126
  • 95
  • 281
  • 483

1 Answers1

2

This ain't well documented.

revokeToken requires you pass a specific accessToken to the method: https://github.com/googleapis/google-auth-library-nodejs/blob/master/src/auth/oauth2client.ts#L801

revokeCredentials accepts no arguments, and revokes the access token currently configured in the OAuth2 instance: https://github.com/googleapis/google-auth-library-nodejs/blob/master/src/auth/oauth2client.ts#L827

Hope this helps!

Justin Beckwith
  • 7,686
  • 1
  • 33
  • 55