Reputation: 947
I implement an auth endpoint which takes an email and password and returns a JWT token. Inside the JWT there is a payload containing the user ID. Does it matter from a REST/JWT standards perspective which of these approaches I take?
/users/user_id
resource on a callback with the decoded user_id and the token/auth
endpoint for the convenience of the client.(my question is implementation/library agnostic and about the api-design pattern)
Upvotes: 6
Views: 4217
Reputation: 947
To summarize the discussion there; if the API is internally used then it matters less, if you are providing an external API with multiple consumers it matters more. There is no discussion of any security risks with either approach.
Upvotes: 2