Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IServiceProvider ConfigureServices(IServiceCollection services)
- {
- // Add framework services
- services.AddSingleton(AutoMapperConfig.Initialize());
- var jwtSettings = Configuration.Get<JwtSettings>();
- services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
- .AddJwtBearer(options =>
- {
- options.TokenValidationParameters = new TokenValidationParameters
- {
- ValidateIssuer = true,
- ValidateAudience = false,
- ValidateLifetime = false,
- ValidateIssuerSigningKey = true,
- ValidIssuer = jwtSettings.Issuer,
- IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtSettings.Key))
- };
- });
- services.AddMvc();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement