ActiveDirectoryMembershipProvider Object Reference not set ...

G

Guest

I have been following several threads between David Thielen and Luke Zhang
[MSFT] regarding the ActiveDirectoryMembershipProvider as used for ASP.NET
2.0 Forms authentication, but I receive a slighly different error. I
consistently receive the following message after submitting credentials from
the login page:

Parser Error Message: Object reference not set to an instance of an object.

Source Error:

Line 30: <providers>
Line 31: <add name="ActiveDirectoryProvider"
Line 32: type="System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
Line 33: connectionStringName="ADService"
Line 34: attributeMapUsername="samAccountName"


This is not the "The specified connection
string does not represent a valid LDAP adspath." issue. I can solve that
with a valid ADSI path as follows:

<connectionStrings>
<add name="ADService" connectionString="LDAP://my.domain.com"/>
</connectionStrings>

From IIS 5 on XP SP2, I initially had trouble with invalid username or
password errors. These coule be solved by supplying the connectionUsername
and connectionPassword settings. On IIS6 from Windows 2003, the application
pool uses a Network Service account in the same domain in the LDAP setting so
I have no problems on that platform.

I can't help but think there is a simple solution to this, but so far I
missing something. I have already looked through several Microsoft articles
including the following:

Explained: Forms Authentication in ASP.NET 2.0
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/PAGExplained0001.asp

How To: Use Forms Authentication with Active Directory in ASP.NET 2.0
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000026.asp

ActiveDirectoryMembershipProvider Class
http://msdn2.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx

ScottGu's Blog: ASP.NET 2.0 Membership, Roles, Forms Authentication, and
Security Resources
http://weblogs.asp.net/scottgu/archive/2006/02/24/438953.aspx

Any ideas or suggestions will be appreciated.
 
G

Guest

After submitting this question, I realized the
...dotnet.framework.aspnet.security group was more appropriate. Please see
the thread that started there

"ActiveDirectoryMembershipProvider Object Reference not set ..."- 4/21/2006

-JD Qixcle
 
G

Guest

As it turns out, the LDAP connection string needed to specify the port number
:389 for a Windows 2000 AD connection.

LDAP://domain.com:389/dc=domain,dc=com

Here is a reference to the post that fixed the problem:
http://forums.asp.net/thread/1137608.aspx


JD Qixcle said:
After submitting this question, I realized the
..dotnet.framework.aspnet.security group was more appropriate. Please see
the thread that started there

"ActiveDirectoryMembershipProvider Object Reference not set ..."- 4/21/2006

-JD Qixcle

JD Qixcle said:
I have been following several threads between David Thielen and Luke Zhang
[MSFT] regarding the ActiveDirectoryMembershipProvider as used for ASP.NET
2.0 Forms authentication, but I receive a slighly different error. I
consistently receive the following message after submitting credentials from
the login page:

Parser Error Message: Object reference not set to an instance of an object.

Source Error:

Line 30: <providers>
Line 31: <add name="ActiveDirectoryProvider"
Line 32: type="System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
Line 33: connectionStringName="ADService"
Line 34: attributeMapUsername="samAccountName"


This is not the "The specified connection
string does not represent a valid LDAP adspath." issue. I can solve that
with a valid ADSI path as follows:

<connectionStrings>
<add name="ADService" connectionString="LDAP://my.domain.com"/>
</connectionStrings>

From IIS 5 on XP SP2, I initially had trouble with invalid username or
password errors. These coule be solved by supplying the connectionUsername
and connectionPassword settings. On IIS6 from Windows 2003, the application
pool uses a Network Service account in the same domain in the LDAP setting so
I have no problems on that platform.

I can't help but think there is a simple solution to this, but so far I
missing something. I have already looked through several Microsoft articles
including the following:

Explained: Forms Authentication in ASP.NET 2.0
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/PAGExplained0001.asp

How To: Use Forms Authentication with Active Directory in ASP.NET 2.0
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000026.asp

ActiveDirectoryMembershipProvider Class
http://msdn2.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx

ScottGu's Blog: ASP.NET 2.0 Membership, Roles, Forms Authentication, and
Security Resources
http://weblogs.asp.net/scottgu/archive/2006/02/24/438953.aspx

Any ideas or suggestions will be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top