Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Created December 6, 2017 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HamidMosalla/1bb7f251c720cdeb104ec9e8330f4181 to your computer and use it in GitHub Desktop.
Save HamidMosalla/1bb7f251c720cdeb104ec9e8330f4181 to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvcCore()
.AddAuthorization(options => options.AddPolicy("Founder", policy => policy.RequireClaim("Employee", "Mosalla")))
.AddJsonFormatters();
services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
options.Authority = "http://localhost:5000";
options.RequireHttpsMetadata = false;
options.ApiName = "Api1";
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment