Suppose user has pressed logout
and her token should be invalidated.
I read, that I can't expire token by demand and should implement some blacklisting or other custom check (which is separate absurd). Okay I put GUID
inside token and also have GUID
in user record. When user logs out, I am deleting her GUID
and then can distinguish that token is invalidated.
But unfortunately, the token is still passing Quarkus
annotations. For example,
@GET
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@RolesAllowed({"MYROLE"})
@SecurityRequirement(name = "auth", scopes = {"auth"})
public Response getUserItems(...params...) {
/// my code
here my code is still executed, because Quarkus
thinks token is okay. I need to add additional check in each endpoint to distinguish invalid tokens.
How to make Quarkus
know token is bad?
question from:
https://stackoverflow.com/questions/65849571/how-to-invalidate-jsonwebtoken-by-demand-in-quarkus 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…