Created
March 6, 2020 07:17
-
-
Save HunnyJummani/cb5c0ebf6065d5ceebe9938356d2c9f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# client => Any Google API client | |
# refresh_token as token in params is mandatory. | |
uri = URI('https://accounts.google.com/o/oauth2/revoke') | |
params = { token: client.refresh_token } | |
uri.query = URI.encode_www_form(params) | |
response = Net::HTTP.get(uri) | |
# will get a {} if access is revoked and errors if any. | |
result = JSON.parse(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment