You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new for JWT. I have created a token for one user. But other users can also use the same token, it's not validating. So how to create token based on the user?
$user_data = "user details";//EG: my id => 23
$token = JWTAuth::fromUser($user_data);
And also I have checked the token using the following line
$check_auth = JWTAuth::toUser($token);
The text was updated successfully, but these errors were encountered:
It's impossible for multiple users to have same token, at least to my understanding;
a valid JSON Web Tokens consist of three parts separated by dots (.), which are:
Header: The header typically consists of two parts: the type of the token, which is JWT, and the signing algorithm being used, such as HMAC SHA256 or RSA
Payload: The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) for example username, _id, email etc.
Signature: To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that
I am new for JWT. I have created a token for one user. But other users can also use the same token, it's not validating. So how to create token based on the user?
And also I have checked the token using the following line
The text was updated successfully, but these errors were encountered: