简体   繁体   English

使用C#针对AD进行身份验证

[英]authenticating against AD using C#

I have this code and am using VS 2005 - works nicely - however, if I try it using VS 2008, doesn't work. 我有这段代码,并且正在使用VS 2005-效果很好-但是,如果我使用VS 2008进行尝试,则无法正常工作。 Any ideas? 有任何想法吗?

webconfig: webconfig:

<connectionStrings>
    <add 
        name="ADService" 
        connectionString="LDAP://kingletvm.creighton.edu/DC=blue,DC=jays,DC=creighton,DC=edu" />
</connectionStrings>
<system.web>
    <membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
        <providers>
            <add 
            name="AspNetActiveDirectoryMembershipProvider"
            type="System.Web.Security.ActiveDirectoryMembershipProvider, 
                    System.Web, Version=2.0.0.0, Culture=neutral, 
                    PublicKeyToken=b03f5f7f11d50a3a"
            connectionStringName="ADService" 
            attributeMapUsername="sAMAccountName" 
            description="Default AD connection"/>
        </providers>     
    </membership>
</system.web>

C# code: C#代码:

Membership.ValidateUser(netid.Text, passwd.Text);

where netid and passwd come from text input boxes. netidpasswd来自文本输入框。

Are you running in 3.5 (or 3.0) in VS 2008? 您是否在VS 2008中以3.5(或3.0)运行? What happens if you change the .NET Framework version to 2.0? 如果将.NET Framework版本更改为2.0,会发生什么? Are you getting any errors or is it just failing authentication? 您收到任何错误还是只是身份验证失败?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 c# 针对 Azure AD 验证用户密码 - How to Authenticate Pasword of User against Azure AD using c# 针对远程服务器和域进行身份验证(C#/ 3.5) - Authenticating against a remote server and domain (C#/3.5) 从C#对ADAM用户进行ADAM身份验证-无法绑定 - Authenticating an ADAM user against ADAM from C# - cannot bind 使用针对Azure AD B2C的OWIN / OIDC对自定义Umbraco控制器进行身份验证 - Authenticating custom Umbraco controller with OWIN/OIDC against Azure AD B2C 针对AD进行检查时,索引超出了c#范围 - Index was out of range c# when checking against AD 在C#中验证DLL - Authenticating DLLs in C# 使用Owin针对Azure AD对用户进行身份验证后,我如何以此用户的身份静默访问CRM Online Web API? - After authenticating a user against Azure AD using Owin how can I silently access CRM Online Web API as this user? 使用基于声明的身份验证对SharePoint 2010的相同AD进行身份验证时,区分Windows Auth和Forms Auth用户 - Differentiate between Windows Auth and Forms Auth users when authenticating against same AD with SharePoint 2010 using claims based authentication 使用PrincipleContext使用sAMAccountName格式向AD进行身份验证 - Authenticating to AD using sAMAccountName format using PrincipleContext HttpWebRequest未使用kerberos针对代理服务器进行身份验证 - HttpWebRequest not authenticating against proxy server using kerberos
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM