I\'d like to increase the lifetime of JWT token but I can\'t.
I tried googling the matter and found references to JwtBearerOptions.TokenValidationParameters.ClockS
There' a typo in Bayram's answer, so I think I should post mine.
The property Expiration
doesn't exist in SecurityTokenDescriptor
. It's DateTime? Expires
.
DateTime expires = input.RememberMe ? DateTime.UtcNow.AddDays(5) : DateTime.UtcNow.AddMinutes(20);
var tokenDescriptor = new SecurityTokenDescriptor
{
Expires = expires,
...
Works perfectly!