Reputation: 41
I'm working on a Symfony project where I handle authentication using JWT tokens, generated with the LexikJWTAuthenticationBundle. I need to create tokens with different expiration times depending on the user's role. Specifically:
If the user has the ROLE_WEBAPP
, the token should be valid for 1.5 days.
If the user has the ROLE_QLIKSENS
, the token should be valid for 1 year.
For all other roles, the token should have a default expiration time like 1 hour.
I've already configured the bundle and it works well with a fixed token_ttl
, but I haven't found a way to dynamically adjust the token's lifetime based on the user's role.
Upvotes: 0
Views: 22