Skip to content

Instantly share code, notes, and snippets.

@sgarcesc
Created March 22, 2017 02:08
Show Gist options
  • Save sgarcesc/2e79f915e92c4f922e2d4e8c1d2f6b52 to your computer and use it in GitHub Desktop.
Save sgarcesc/2e79f915e92c4f922e2d4e8c1d2f6b52 to your computer and use it in GitHub Desktop.
.NET Core Authorize filter
var defaultPolicy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.Build();
services.AddMvc(setup =>
{
setup.Filters.Add(new AuthorizeFilter(defaultPolicy));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment