I'm using Microsoft.IdentityModel.Tokens
to create a JWT
but I need a token with no expiration date, can I create that token with the CreateJwtSecurityToken
function? I tried ignoring the expires
parameter but that not work.
Asked
Active
Viewed 153 times
1

M. Gar
- 889
- 4
- 16
- 33
1 Answers
1
An alternative is to have the ASP.NET WEB.API to ignore the expire dates of the token using this property:
TokenValidationParameters.ValidateLifetime
You set it inside AddJwtBearer(...);
To complement this answer, I wrote a blog post that goes into more detail about this topic: Troubleshooting JwtBearer authentication problems in ASP.NET Core

Tore Nestenius
- 16,431
- 5
- 30
- 40