Skip to content

Instantly share code, notes, and snippets.

@radzionc
Created October 7, 2020 13:49
Show Gist options
  • Save radzionc/52d651a66beb28c2d2a2dfceaae2cf6f to your computer and use it in GitHub Desktop.
Save radzionc/52d651a66beb28c2d2a2dfceaae2cf6f to your computer and use it in GitHub Desktop.
var tokenValidationParameters = new TokenValidationParameters()
{
RequireExpirationTime = true,
ValidateIssuer = false,
ValidateAudience = false,
IssuerSigningKey = new SymmetricSecurityKey(Convert.FromBase64String(SecretKey))
};
app.UseJwtBearerAuthentication(new JwtBearerOptions
{
AutomaticAuthenticate = true,
AutomaticChallenge = true,
TokenValidationParameters = tokenValidationParameters
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment