I have an application that connects to google and get the profile details, everything works fine with the authorization and getting the profile.
However I want to add the option to revoke access from my application, and currently I don’t see this possible programmatically.
google api to revoke token:
curl -d -X -POST --header "Content-type:application/x-www-form-urlencoded" \
https://oauth2.googleapis.com/revoke?token={token}
I’m using fetch to call the remote:
const google = api.asUser().withProvider('google', 'google-oauth');
const response = await google.fetch('/revoke', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'}});
in this case the token is actually never sent and I always get bad request error.
since bearerMethod type “form-encoded” and “uri-query” is depreciated there is no way to call the revoke.
does anyone have a solution?