예제 #1
0
        public static TokenValidationParameters ValidationParameters(this JwtConfiguration config)
        {
            return(new TokenValidationParameters
            {
                ValidateIssuer = true,
                ValidIssuer = config.Issuer,

                ValidateAudience = true,
                ValidAudience = config.Audience,

                ValidateIssuerSigningKey = true,
                IssuerSigningKey = config.SigningKey(),

                RequireExpirationTime = false,
                ValidateLifetime = true,
                ClockSkew = TimeSpan.Zero
            });
        }
예제 #2
0
 private static SigningCredentials SigningCredentials(this JwtConfiguration config)
 {
     return(new SigningCredentials(config.SigningKey(), SecurityAlgorithms.HmacSha256));
 }