Stephan van Hulst wrote:
I'm more concerned about what you mean by validating the token. Who signs the token? You? A third party? Is the party that signs the token also the holder of the protected resource?
In case you neither do the signing nor hold the protected resource, then why are you validating the token at all? Just pass it on to the holder of the protected resource.
I think that OP means with "validation", the process to verify if the caller may or not access a given resource, i.e at the very end, extract claims and reconstruct roles. Anyway your concern is really a good point...
In my own experience, I used to use an external Identity and Access Management (IAM) system, like KeyCloack, to handle the authentication mechanism and to generate JWT tokens. Depending upon the security level you want
to achive, you can rely on it for validating JWT, signing tokens, handling revocation, and so on. But for simple scenarios, this architecture may be overkill. If you are the token issuer, you may store the tokens you have issued somewhere - on a DBMS, on simply in memory : at every API call, just verify if the token is in your registry or not, and accept or reject is accordingly.