dimanche 10 juin 2018

Add user properties to Laravel passport token

Hi I am wanting to add some extra properties in the access token generated using Laravel passport. I am using Laravel 5.6

Example Decoded token:

aud:"1"
exp:1528505818
iat:1528498618
jti:"10c880c491ecb73e39a6b1d7614b4be4e13ef4adf71fbc6f858a69899461fecc001fdefb60a287c1"
nbf:1528498618
scopes:[]
sub:"1"
user: {
  name: "test"
  role: "admin
}

I have read other articles but they only attach the user object to the response rather than encoding it in the token.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire