Created
July 22, 2019 14:33
-
-
Save ntakouris/05f0b069bad44b85e98ce43bab6376a1 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