User288213138 posted
Hi jalali,
Hi Friends,
I simply want to authenticate the username and password with my Domain's AD... I don't want to use Identity Framework...
What is the best way to achieve this can I simply write a class method to authenticate? Can anyone give me working example?
You can try 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:
1.If you will only run this on a Windows server, then you can install and use the Microsoft.Windows.Compatibility NuGet package.
2.Use the third-party Novell.Directory.Ldap.NETStandard.
And you can refer to this link about the answers on this question that describe how to implement both solutions.
https://stackoverflow.com/questions/49682644/asp-net-core-2-0-ldap-active-directory-authentication/49742910#49742910
Hope this can help you.
Best regards,
Sam