Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ASP.Net Core 2.0 - Configure JWT Auth - startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateLifetime = true,
ValidateIssuerSigningKey = true,
IssuerSigningKey = new SymmetricSecurityKey(
System.Convert.FromBase64String(_configuration["ApproovTokenSecret"]))
};
});
services.AddMvc();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment