Closed aagjalpankaj closed 2 years ago
Do you mean to include extra data in the JWT token itself, in its JSON payload?
@dusterio - Yes.
@dusterio - e.g.
{
"aud": "9420abb1-1470-4895-8666-a702b415cb59",
"jti": "1dd56723fa5ac4421ebb7cb9a0222686f368de22760d9ac7038b8a3a696ac12069b84e2434ea9d75",
"iat": 1635772661.715073,
"nbf": 1635772661.71508,
"exp": 1635774461.676158,
"sub": "8707e4a1-a920-40dc-a472-b71b62343dca",
"user_id": 123,
"sites": { "78": 1, "60": 3 }
"scopes": []
}
In the above payload "user_id" & "sites" is the custom data. How to pass such custom data using this package? We can do this in "tymon/jwt-auth" - https://medium.com/geekculture/restrict-jwt-token-with-ip-address-using-laravel-77ce5ae3671a
@dusterio +1. Any way to achieve it?
I think there are some examples at the end of this thread: https://github.com/laravel/passport/issues/94
How to pass custom data (like user_id, roles, etc) in payload along with
sub
?