I am using the ASP.NET Core 2.1 React SPA Microsoft template.
I want to use Active Directory for user authentication. Our server runs on a corporate network using Active Directory domain identities.
How can I do it?
The best way is to use Windows authentication. However, that will only work if the server you run this on is joined to the domain (or a trusted domain).
If not, then you will have to use Forms Authentication, where the user enters their username and password, and you authenticate against AD in your code via LDAP. There are two ways to do this in .NET Core:
Microsoft.Windows.Compatibility
NuGet package.Novell.Directory.Ldap.NETStandard
.There are two answers on this question that describe how to implement both solutions.