Friday, August 26, 2016

Best practice for storing ASP.NET Core Authorization claims when authenticating users against Active Directory?

Leave a Comment

I am creating an enterprise intranet ASP.NET Core MVC application. I want my users to authenticate using Active Directory and I want user authorizations (claims) stored in ApplicationDbContext.

I assume that I need to use Microsoft.AspNetCore.Identity and Microsoft.AspNetCore.Identity.EntityFrameworkCore to accomplish my goals. What is the best practice for storing ASP.NET Core Authorization claims when authenticating against Active Directory?

The following code will give me access to the current windows user security context (current logged in user), from within the pipeline. Somehow I need to map the user with associated Microsoft.AspNetCore.Identity claims?

 app.Use(async (context, next) =>  {       var identity = (ClaimsIdentity) context.User.Identity;       await next.Invoke();  }); 

Thanks in advance for the help!

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment