Is it ok to store user credentials in the JWT

后端 未结 3 2021
囚心锁ツ
囚心锁ツ 2020-12-31 08:52

Is it ok to store user credentials (username / password) in the JWT (so sign it and verify the resulted token later)?

I heard that

3条回答
  •  温柔的废话
    2020-12-31 09:26

    You should use jwt only to store a token which your API will consume. The token will be generated after a successful login and it can be attached to any request sent to your API and all request should be proceeded only if the token is valid.

提交回复
热议问题