Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Claim based authorization using policies - not found AddAuthorization()

$
0
0

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


Viewing all articles
Browse latest Browse all 4737

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>