Hi,
I'm having a problem connecting my web application to an Active Directory running on Windows 2000 Server (SP4).
It works fine if I connect to an AD on Windows Server 2003, but if I try to use the AD on Windows 2000 Server I get this error message:
Object reference not set to an instance of an object
And shows is red the ActiveDirectoryMembershipProvider section on the web.config.
I think the connection string and credentials are ok, because I used them on a LDAP Browser and succeed to connect to the AD. But on the web application I'm getting this error when I try to login.
If I remove the Membership.ValidateUser method from my login page I can enter in the application.
What could be wrong? The Provider connection? Incompatibility with Windows 2000 Server AD?
[u]Here is the Stack Trace:</u>
System.Web.Configuration.ProvidersHelper.Instantia teProvider(ProviderSettings providerSettings, Type providerType)
em System.Web.Configuration.ProvidersHelper.Instantia teProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType)
em System.Web.Security.Membership.Initialize()
em System.Web.Security.Membership.ValidateUser(String username, String password)
em Login.btnLogin_click(Object sender, EventArgs e) em C:\Users\[USER]\Desktop\[AppFolder]\Login.aspx.
vb:line 40
em System.Web.UI.WebControls.Button.OnClick(EventArgs e)
em System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument)
em System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
em System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
em System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
em System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
em System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
em System.Web.UI.Page.ProcessRequest()
em System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context)
em System.Web.UI.Page.ProcessRequest(HttpContext context)
em ASP.login_aspx.ProcessRequest(HttpContext context)
em System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
em System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
[u]And here is my web.config:</u>
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="Sql2000Server" connectionString="Server=SQLSERVER\SQLINSTANCE;uid =USER;pwd=PASS;database=SQLDB"/>
<add name="ADConnectionString" connectionString="LDAP://aaa.bbb.ccc.dd.pt:389/DC=bbb,DC=ccc,DC=dd,DC=pt"/>
</connectionStrings>
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login.aspx" defaultUrl="~/requisicao/extracto.aspx" protection="All" timeout="30" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<membership defaultProvider="AspNetActiveDirectoryMembershipPr ovider">
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershi pProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="/" connectionStringName="ADConnectionString" connectionUsername="xxxxx" connectionPassword="*****" connectionProtection ="None" attributeMapUsername="sAMAccountName" />
</providers>
</membership>
I would appreciate any help because I don't know what to do anymore. I've tried so many things with no success :(
Thanks!