LexikJWTAuthenticationBundle
LexikJWTAuthenticationBundle copied to clipboard
Questions about TTL
For some applications talking to my API I need to create JWTs with TTLs different from my default one of 3600. How do I do that given that lexik:jwt:generate-token
doesn't have a ttl
parameter?
Also, how is it possible to write some logic to set the TTL on a per user basis?
I think you can use Custom User Checker for this.
TTL per user basis indicates that it is a User's property. In this case it can be where user is, e.g. in database. You can also have it as per Role basis. You can use this property in Custom User Checker to decide whether to allow authentication or not.
I think you can use Custom User Checker for this.
TTL per user basis indicates that it is a User's property. In this case it can be where user is, e.g. in database. You can also have it as per Role basis. You can use this property in Custom User Checker to decide whether to allow authentication or not.
+1 I think this is the solution for this case.