When a password is expired what rest api should return? I mean: username and password are correct, but expired.
Here I found that
The mechanisms for expiring or revoking credentials can be specified as part of an authentication scheme definition.
Is there a specification about what's the right and/or correct http status code for expired credentials? Is http status code good to handle with credentials expiration?
An expired password is an invalid password and must not be accepted by the server.
So if you are using HTTP authentication (sending credentials in the
Authorization
header), you can use401
with a descriptive payload.Here are some quotes from the RFC 7235, the reference for authentication in HTTP/1.1:
http://getstatuscode.com/419