C#网页登录认证通过LDAP

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9426502/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 07:22:26  来源:igfitidea点击:

C# webpage Login authentication via LDAP

c#asp.netactive-directory

提问by Fernando

An employee of a company logs into the company webpage using a company LDAP username and password. I don't have an idea how to create it.

某公司员工使用公司 LDAP 用户名和密码登录公司网页。我不知道如何创建它。

Please give me an idea and code sample for creating this using asp.net with c#.

请给我一个想法和代码示例,使用带有 c# 的 asp.net 创建它。

please help me...

请帮我...

回答by mfanto

Are you using the ASP.NET Membership Provider? There's an ActiveDirectoryMembershipProviderthat can handle authentication to Active Directory. I'm not sure if it'll work with a pure LDAP server, or if you are using AD, but this might get you started in the right direction.

您是否在使用 ASP.NET 成员资格提供程序?有一个ActiveDirectoryMembershipProvider可以处理对 Active Directory 的身份验证。我不确定它是否适用于纯 LDAP 服务器,或者您是否正在使用 AD,但这可能会让您朝着正确的方向开始。