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

不羁的心 提交于 2019-12-11 09:57:01

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/31314549/authenticate-user-through-active-directory-ldap-with-asp-identity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!