REST API: HTTP Status code for auth violation -


i'm implementing rest api , auth module based on jwt. here below http status codes i've defined it:

  • request without auth token: 401 unauthorized
  • auth token expired: 410 unauthorized
  • auth token not contain required claims: 403 forbidden
  • auth violated (i.e. token tampered): ???

in case of token tampering, http status code should use? 401 (unauthorized or 417 (expectation_failed)?

how can tell if token tampered with? seems me can know if it's correct or incorrect. trying use invalid token seem me unauthorized. expectation_failed refers expect header, doesn't seem appropriate here.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -