Google-api-dotnet-client: Revoking a token results in 404

Created on 23 Sep 2018  路  3Comments  路  Source: googleapis/google-api-dotnet-client

When trying to revoke an access token using the GoogleAuthorizationCodeFlow.RevokeTokenAsync method, I discovered a 404 response.

I believe the reason is that the Google.Apis.Auth.OAuth2.GoogleAuthConsts.RevokeTokenUrl is wrong, which is pointing to "https://oauth2.googleapis.com/revoke", while the documentation here defines that the URL should be "https://accounts.google.com/o/oauth2/revoke".
I tested it with the URL from the docs and it works.

However currently I can't submit a pull request which corrects the URL because there is a test in
https://github.com/googleapis/google-api-dotnet-client/blob/master/Src/Support/IntegrationTests/AuthUriConstsTests.cs which verifies that the URLs match the one provided in the google openid connect discovery document.
Therefore I also think that even the discovery document contains a wrong revoke token URL.

  1. I understand that this client library can't change the discovery document. But can you please guide me whereto I shall submit an issue tackling this problem?
  2. Using the following workaround token revocation works:
    ~C#
    var googleAuthorizationCodeFlow= new googleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer()
    {
    ...
    RevokeTokenUrl = "https://accounts.google.com/o/oauth2/revoke",
    ...
    });
    ~
p1 bug

Most helpful comment

This is because the current revoke code uses a GET request, but the new URL requires a POST request. See https://github.com/googleapis/google-cloud-common/issues/260#issuecomment-413231697
This is a bug for which we should have an integration test, but don't; I'll fix it, and a test, and do a release.
Thanks for reporting this bug.

All 3 comments

This is because the current revoke code uses a GET request, but the new URL requires a POST request. See https://github.com/googleapis/google-cloud-common/issues/260#issuecomment-413231697
This is a bug for which we should have an integration test, but don't; I'll fix it, and a test, and do a release.
Thanks for reporting this bug.

I've also stumbled upon this bug. Hope you will be able to fix it soon.

This is fixed in the v1.36.0 release, available on nuget.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iwillspeak picture iwillspeak  路  7Comments

nognomar picture nognomar  路  4Comments

LindaLawton picture LindaLawton  路  9Comments

riyadparvez picture riyadparvez  路  9Comments

LindaLawton picture LindaLawton  路  9Comments