Use standard Active Directory in an ASP.NET Core application?

I am creating a new ASP.NET Core 1.0 application. One requirement is to use Active Directory to authenticate users. Unfortunately, our organization uses only the "old" Active Directory. We do not use Azure Active Directory at all.

When I create a new project in Visual Studio 2015, there is no option for the "Change Authentication" option:

enter image description here

What is the best way to do this?

+5
source share
2 answers

This is currently not possible.

ASP.NET Core only supports OpenID Connect OIDC. The current versions of ADFS that you need to create a single organization on premises only support WSFed, which is not yet implemented in Core and is unlikely to be implemented in Core RTM. ADFS also supports OAuth, but the AAD team that writes the code for this part focuses on OIDC.

+3
source

ASP.NET Core 1.0 RC2 can use Windows authentication. The following code will give you access to the AD user authentication object in the Configure () function. I did not find an elegant way to map this identifier with the permissions of Microsoft.AspNetCore.Identity in ApplicationDbContext.

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

I sent a similar question you might want: Best practice for storing authorization applications for an ASP.NET core resource when authenticating users in Active Directory?

+1
source

Source: https://habr.com/ru/post/1246192/


All Articles