I am creating a new ASP.NET Core 1.0 app. One of the requirements is to use Active Directory for user authentication. Unfortunately our organization only uses 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 this under "Change Authentication":
What's the best way to do this?
Select ASP.NET Core Web Application>Choose Web Application (Model-View-Controller) template> Click on the "Change Authentication" button>Select "Work or School Accounts". Choose Cloud - Single Organization. Fill up the field of Domain which is the Azure Active Directory tenant name (say, softdreams.onmicrosoft.com).
It's currently not possible.
ASP.NET Core only has support for OpenID Connect OIDC. Current ADFS versions, which is what you need to do single organisation on premises only support WSFed,, which is not yet implemented in Core and is unlikely to be implemented in Core by RTM. ADFS also supports OAuth, but the AAD team, who write the code for that piece have been concentrating on OIDC.
ASP.NET Core 1.0 RC2 can leverage Windows Authentication. The following code will get you access to the AD user identity object in the Configure() function. I have not discovered an elegant way to map this identity to Microsoft.AspNetCore.Identity authorizations in ApplicationDbContext yet.
app.Use(async (context, next) =>
{
var identity = (ClaimsIdentity) context.User.Identity;
await next.Invoke();
});
I have posted a similar question that you may want to follow: Best practice for storing ASP.NET Core Authorization claims when authenticating users against Active Directory?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With