-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add token revocation support #995
base: master
Are you sure you want to change the base?
Conversation
BTW, I couldn't figure out how to get it to pass both tests, if I have a function that sometimes returns null. The style checker wants me to change "return null" to "return", but if I do that, I get a CI error. |
Is there any alternative approach you can take? I am not a fan of blank returns and would prefer the code is more explicit. For example, if token verification fails, could we use exceptions to issue an error rather than aborting the execution? |
Sure, I refactored it to avoid returning null, and just made it revoke the token right away. |
Is there any reason this PR is not merged? I'd like to use the revoke in one of my project |
@neodc right now it looks like there are merge conflicts |
I think this may need some re-working – it was written for 7.x, and 8.0.0 has come out since then. Not sure I'll have time right now to do it, but if you guys are still interested in merging it, I can try. |
My attempt to implement a fix for #806.
AbstractGrant
into aRequestValidatorTrait
trait, so they can be used by non-grant classes. This trait includes some abstract methods, to get the client repository and the grant identifier. Those could be refactored into arguments tovalidateClient
, if that's preferable.RevokeTokenHandler
class to handle revocation. The constructor requires the refresh token repository and the public key as arguments. Uses existing repository methods for revocation.enableRevokeTokenHandler
method toAuthorizationServer
to be used during setup.respondToRevokeTokenRequest
method toAuthorizationServer
, to be used in a POST request, similar torespondToAccessTokenRequest
. CORS support is up to the application.$canRevokeAccessTokens
in theRevokeTokenHandler
constructor if you want to allow access tokens to be revoked, since the spec describes this as optional.