-
Notifications
You must be signed in to change notification settings - Fork 1.3k
token_type_hint should be used as a hint only #175
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
Comments
Hm, this is an interesting one. I also think the hint should not restrict to a specific type. If everyone agrees, I can also make the change with #170 which is on my side on the same code. |
Btw, isn't that very related also with #174 you registered earlier? |
@rozagerardo The request you specified is not valid, since you're trying to revoke an access token but the Furthermore, as per spec in 2.2. Revocation Response:
Given that the request is invalid, the expected response is still 200. I'm going to close this as the current behaviour is inline with spec. |
Sorry @jgrandja I know you have a lot to go through for this project, but can we discuss this a little bit further? I'm pretty much sure I'm not misunderstanding the specs. As I understand it, the
Regarding the note you mentioned:
Note that here the spec mentions invalid token, but the validity of the token has nothing to do with the request we made, and the parameters we passed. Of course, in any case the response should be 200, but the outcome should be different (the token should be revoked). Let me know what you think about this, if you are still not sure, I can explore some well-known solutions like Keycloak or Okta to see how they handle these scenarios. |
@rozagerardo I see your point as well but revoking an access token when I would be interested to see what Keycloak and Okta do in these instances. If you can explore those providers and any other ones that would be very helpful. |
Cool @jgrandja. Yes, I agree this is an edge case (why would a Client explicitly indicate a wrong token type?), but if it's part of the spec we should respect that. And sorry @lspil , I didn't answer your last question. This is somewhat related to #174, but it's actually a different scenario. 2- The issue in #174 on the other hand was solved here by not retrieving the |
Reporting back about this @jgrandja (since you're out for the holidays and this is a closed issue I might ping you again a few days after you return). Here are two videos demoing the Introspection and Revocation endpoints for Okta and Keycloak: The highlights are: 1- They both seem to work according to the hypothesis I presented in this issue; both endpoints for both framework process the request normally regardless of the 2- Particularly, for just for Keycloak's Introspection endpoint, the service responds with a 400 Bad Request when an unknown 3- I think we both agree with this point, but it's worth mentioning that, as shown in the video, we have a case of when to use the Let me know if there is anything else I should explore here, if I should reopen this issue or create a PR with a solution similar to the one I presented for the Introspection Endpoint here. |
@rozagerardo You got me on the same page as you 👍 Ok, let's align with:
Would you like to submit a PR for this fix? Also, I agree with your statement:
|
Sounds great @jgrandja, I have now prepared the following PR: Note the integration tests mock the method we're using here, I've validated the functionality by running the sample and revoking a token manually as well, just to be sure everything is working as expected 👍 Looking forward to the comments! And happy new year BTW! |
Describe the bug
Currently, if we pass a
token_type_hint
parameter that doesn't match thetoken
we passed, the token is not revoked. the parameter should be just a hint to find the token, but as indicated in the specs, if it is not found using thetoken_type_hint
value, then the rest of the supported types should be used:To Reproduce
1- Issue an Access Token
2- Send a request as follows:
3- Server responds with 200, but the token is not revoked
Expected behavior
Server should still revoke the Access Token
The text was updated successfully, but these errors were encountered: