I'm implementing a REST API and the auth module is based on JWT. Here below are the HTTP status codes I've defined for it:
In case of token tampering, what HTTP status code should I use? 401 (UNAUTHORIZED or 417 (EXPECTATION_FAILED)?
How can you tell if the token was tampered with? It seems to me that you can only know if it's correct or incorrect. Somebody trying to use an invalid token would seem to me to be UNAUTHORIZED
. EXPECTATION
_FAILED refers specifically to the Expect
header, which doesn't seem appropriate here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With