2

I’m implementing asp.net core 3. I want to create a login page for users who are in the active directory using LDAP.I can not find any exhausting guidance for asp.net core 3 through which I can get help for implementing it. I appreciate if any one suggests me a tutorial or any relevant sample.

Gabriel Luci
  • 28,970
  • 3
  • 37
  • 58
hrz
  • 113
  • 3
  • 10
  • Have you check out the [official docs](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1&tabs=visual-studio#kestrel) ? – itminus Feb 28 '20 at 02:52
  • 1
    Thank you very much for your response. You suggested me a link for windows authentication bu I need to implement ASP.NET Core 3.0 LDAP Active Directory Authentication – hrz Feb 28 '20 at 06:20
  • If your computer belongs to a domain, the above link also works fine for AD Authentication :) – itminus Feb 29 '20 at 07:18

1 Answers1

4

Ideally, you can use Windows Authentication. This is best for an intranet application. If the user's log into their computers with the same account that they need to authenticate to your website, then as long as the website is trusted (added to the Trusted Sites in Internet Options in Windows) then their credentials will be automatically sent and they will not have to put in their username and password themselves.

However, if your situation does not meet the criteria for that to work, then you need to build your own authentication. You're taking a username and password from the user and validating it, just like you would if you had your own database of users. The only difference is how you validate them.

The answers to this question might help get you started: ASP.NET Core 2.0 LDAP Active Directory Authentication

Or there are other examples if you search Google for "asp.net core ldap auth".

Gabriel Luci
  • 28,970
  • 3
  • 37
  • 58
  • Thank you for your great response. So you think for ASP.NET Core 3.0 LDAP Active directory Authentication, there is no any resource? – hrz Mar 04 '20 at 07:55
  • There are resources if you click on the last link in my answer. – Gabriel Luci Mar 04 '20 at 12:21