Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revoke Token : UserAuthorizer revokeAuthorization error #782

Closed
blachot opened this issue Nov 2, 2021 · 6 comments
Closed

Revoke Token : UserAuthorizer revokeAuthorization error #782

blachot opened this issue Nov 2, 2021 · 6 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@blachot
Copy link

blachot commented Nov 2, 2021

Hello,

UserAuthorizer.revokeAuthorization(String userId) method seems to contain an error
URL to revoke token is call with GET method instead POST :
HttpRequest tokenRequest = requestFactory.buildGetRequest(revokeUrl);
The service return an 404 error

Environment details

  1. https://oauth2.googleapis.com/revoke
  2. OS type and version:Windows, Linux
  3. Java version:11
  4. google-auth-library version(s): 1.2.2

Code example

        val userCredentials: UserCredentials = getGoogleApiCredentials(userAccount)
        val authorizer: UserAuthorizer = UserAuthorizer.newBuilder()
            .setClientId(ClientId.of(userCredentials.clientId, userCredentials.clientSecret))
            .setScopes(GmailConfig.GMAIL_SCOPE)
            .build()
        authorizer.storeCredentials(userAccount.userId, userCredentials)
        authorizer.revokeAuthorization(userAccount.userId)

Stack trace

Failed to revoke token for ck4CBxWMHUVnRUU0clImuG3Jmlt2
com.google.api.client.http.HttpResponseException: 404 Not Found
GET https://oauth2.googleapis.com/revoke?token=1//03EeIawv2OnUHCgYIARAAGAMSNwF-L9IrgKmtqRiSR5dTeUF_lgeuKXJ-cfA5eKhGfA6vpCUJ1MgxBJuhxGbk_WkYPQEs0gitNx4

@lesv lesv added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Nov 3, 2021
@lesv
Copy link
Contributor

lesv commented Nov 3, 2021

I'm not an expert in auth, but if I were to guess, I would suspect that the scope you are using isn't enough.

That said, when I look at the example for raw html revocation it doesn't seem to need any kind of auth token, other than the one you wish to stop. Which would suggest your addition of authorizer might not be required.

@blachot
Copy link
Author

blachot commented Nov 3, 2021 via email

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Mar 13, 2022
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label May 1, 2022
@TimurSadykov
Copy link
Member

Will try to reproduce and update the status

@TimurSadykov
Copy link
Member

ETA Jun 27

@TimurSadykov TimurSadykov added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jun 25, 2022
@TimurSadykov
Copy link
Member

dropping priority until repro confirmed

@yoshi-automation yoshi-automation removed the 🚨 This issue needs some love. label Jun 25, 2022
@sai-sunder-s
Copy link
Contributor

Fixed in #979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

5 participants