Hi All,
I am trying to implement Claim based authorization using Policies. I added following code in startup.cs but I am getting an error like AddMvc()/AddPolicy not found. Also I install the Microsoft.Framework.DependencyInjection.IServiceCollection using Nuget package but still getting the same error. Please let me know how can I fix this issue.
I am using visual studio 2013, Web Api and c#.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddAuthorization(options =>
{
options.AddPolicy("Project.View", policy => policy.RequireClaim("ProjectView"));
});
}
Thanks
Selvakumar R