I just started to get familiar with JWT and one question popped up, how to decrypt JWT on the server side without knowing what secret is used? Let's say we protect REST API /user
endpoint with JWT Token. The user generates a Token and passes using the header
Authorization: Bearer <token>
How we may know the user id to get his secret for JWT Token decryption?
Can we pass the User ID along with a token like this
Authorization: Bearer <token> <UserID>