Authentication and tokensintermediate
A JWT is a signed note saying who the caller is; issuing one, refreshing it before it expires, and never storing a password in plain text are the three things every API has to get right.
JWT with roles, a refresh endpoint, and passwords that are never stored in plain text.
POST /auth/login returns 200 with a token pair for good credentials and 401 for bad ones.
Published in full, before you start — every point is one of these and there is nothing else.
A JWT is a signed note saying who the caller is; issuing one, refreshing it before it expires, and never storing a password in plain text are the three things every API has to get right.
Authentication is who you are; authorization is what you are allowed to do. Policies keep that rule in one place instead of scattered if-statements.