Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between revokeCredentials and revokeToken?

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.

like image 543
slideshowp2 Avatar asked Sep 02 '25 03:09

slideshowp2


1 Answers

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!

like image 161
Justin Beckwith Avatar answered Sep 04 '25 23:09

Justin Beckwith