简体   繁体   中英

Authenticate user through active directory (LDAP) with ASP.Identity

I've looked around on how to do this but no luck so far. Anyone know where to start? Basically my company have active directory server and I build a site where user will use their company account to login.

I've tried Organizational Accounts option from Visual Studio Web Application but it returned Invalid domain name . Pic below

在此处输入图片说明

Any help will be appreciated.

From what I understand of your question, you're looking for forms authentication via Active Directory, which would be 'Individual Accounts' in the list above.

Microsoft has a guide on how to achieve this. The guide is for ASP.NET Web Forms but should be easily transferable to MVC, just try not to overcomplicate anything.

Google searching around this area should be done with caution as it is easy to confuse Forms authentication against AD with Windows authentication against AD, and if you want to use a login form, you definitely want forms. You will likely also want to make sure that

A breakdown for the guide;

  1. Step 1

    Create a forms authentication based website.

  2. Step 2

    Override Machine.config for Forms with your Web.config

  3. Step 3

    Configure the ActiveDirectoryMembershipProvider and relevant connection strings to connect to your AD server.

  4. Step 4

    Wire it all up and apply validation to the form.

relevant link 1

relevant link 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM