AngularASPNETCore2WebApiAuth icon indicating copy to clipboard operation
AngularASPNETCore2WebApiAuth copied to clipboard

SecurityTokenExpiredException when the server runs for a few hours

Open Tim-Pohlmann opened this issue 4 years ago • 0 comments

When the server runs for a while it stops handing out valid JWT tokens. They all have the same expiration date. The reason for this is the fact that JwtFactory is Singleton and injects IOptions<JwtIssuerOptions>. JwtIssuerOptions.IssuedAt is set to DateTime.UtcNow at program start and never reevaluated.

Tim-Pohlmann avatar Apr 17 '20 07:04 Tim-Pohlmann