Esempio n. 1
0
 private static void ConfigureTokenValidationParameters(TokenValidationParameters validationParameters, JwtBearerTokenOptions tokenOptions, SigningOptions signingOptions)
 {
     validationParameters.IssuerSigningKey         = signingOptions.SecurityKey;
     validationParameters.ValidAudience            = tokenOptions.Audience;
     validationParameters.ValidIssuer              = tokenOptions.Issuer;
     validationParameters.ValidateIssuerSigningKey = true;
     validationParameters.ValidateLifetime         = true;
     validationParameters.ClockSkew = TimeSpan.Zero;
 }
Esempio n. 2
0
 public JwtBearerGenerator(IOptions <JwtBearerTokenOptions> jwtBearerTokenOptions, IOptions <SigningOptions> signingOptions)
 {
     _jwtBearerTokenOptions = jwtBearerTokenOptions.Value;
     _signingOptions        = signingOptions.Value;
 }