Created
July 22, 2019 14:34
-
-
Save ntakouris/c83d94dd31aa92f04e7da83bab310f58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tokenValidationParameters = new TokenValidationParameters | |
{ | |
ValidateIssuerSigningKey = true, | |
IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(jwtSettings.Secret)), | |
ValidateIssuer = false, | |
ValidateAudience = false, | |
RequireExpirationTime = false, | |
ValidateLifetime = true | |
}; | |
services.AddSingleton(tokenValidationParameters); | |
services.AddAuthentication(x => | |
{ | |
// ... | |
}) | |
.AddJwtBearer(x => | |
{ | |
x.SaveToken = true; | |
x.TokenValidationParameters = tokenValidationParameters; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment