mmacneil / AngularASPNETCore2WebApiAuth

Sample project demonstrating jwt-based authentication with an Angular (v5.2.1) frontend and ASP.NET Core 2 WebApi. Includes both local user registration with .NET Core Identity membership and facebook login scenarios.
https://fullstackmark.com/post/13/jwt-authentication-with-aspnet-core-2-web-api-angular-5-net-core-identity-and-facebook-login
MIT License
470 stars 239 forks source link

SecurityTokenExpiredException when the server runs for a few hours #16

Open Tim-Pohlmann opened 4 years ago

Tim-Pohlmann commented 4 years ago

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.IssuedAt is set to DateTime.UtcNow at program start and never reevaluated.