Answer the question
In order to leave comments, you need to log in
Is it ok to store roles in jwt token?
Can you please tell me if it is normal and generally possible to store roles in a jwt token? For example, this is how payload looks like
{
"id": "1",
"role": "admin"
}
Answer the question
In order to leave comments, you need to log in
JWT does not guarantee security for sensitive data as it does not hide or encrypt payload content by default. Essentially, tokens are used for authorization.
Therefore, storing the role in the payload of the token is the norm. And the password, pin from the card or home address is not the norm.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question