Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Failed forms authentication with LDAP

Reply
Thread Tools

Failed forms authentication with LDAP

 
 
Lino Garcia
Guest
Posts: n/a
 
      09-29-2005
Hi,
I'm using the walkthrough described in
http://msdn.microsoft.com/library/de...SecNetHT02.asp

and I followed step by step.

However, when I try with a valid AD account/password combination the code
always throws an exception in the line


Object obj = entry.NativeObject;

The full exception message is:

"System.Runtime.InteropServices.COMException (0x8007202B): A referral was
returned from the server\r\n at
System.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)\r\n at
System.DirectoryServices.DirectoryEntry.Bind()\r\n at
System.DirectoryServices.DirectoryEntry.get_Native Object()\r\n at
AdminBuros.DAL.LDAPAuthentication.IsAuthenticated( String domain, String
username, String pwd) in
c:\\administracionburos\\dal\\adminburos.dal\\ldap authentication.cs:line 38"

If I try with an invalid AD account/password, arises another exception:

"System.Runtime.InteropServices.COMException (0x8007052E): Logon failure:
unknown user name or bad password\r\n at
System.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)\r\n at
System.DirectoryServices.DirectoryEntry.Bind()\r\n at
System.DirectoryServices.DirectoryEntry.get_Native Object()\r\n at
AdminBuros.DAL.LDAPAuthentication.IsAuthenticated( String domain, String
username, String pwd) in
c:\\administracionburos\\dal\\adminburos.dal\\ldap authentication.cs:line 38"


My environment is a development environment, AD in a Windows 2000 Server and
my ASP.NET application running in XP Pro SP2 machine. The <processmodel>
setting in machine.config is configured to : SYSTEM.
The setting :
<identity impersonate="true" />
is present in my web.config file.

The IIS virtual directory is configured as an IIS application with :

-Execute Permissions : Script Only
-Application Protection : Medium (Pooled)
-Authentication Methods:
* Anonymous Access, configured with a valid domain account. The MSDN article
I mentioned does not specify if this account could be a domain or local
account, just that it has to be a less privileged account.
* Integrated Windows Authentication

The code from the MSDN article was copied to a C# class type .NET project,
which in turn is called by an ASP.NET web form which makes a project type
reference to the class project.
I've not tried the code from a windows form application however.

Can somebody give me a hint about what's happening?

Best regards.


 
Reply With Quote
 
 
 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      10-31-2005
Lino are you still getting the error?
Patrick

"Lino Garcia" <Lino http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
> I'm using the walkthrough described in
>

http://msdn.microsoft.com/library/de...SecNetHT02.asp
>
> and I followed step by step.
>
> However, when I try with a valid AD account/password combination the code
> always throws an exception in the line
>
>
> Object obj = entry.NativeObject;
>
> The full exception message is:
>
> "System.Runtime.InteropServices.COMException (0x8007202B): A referral was
> returned from the server\r\n at
> System.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)\r\n at
> System.DirectoryServices.DirectoryEntry.Bind()\r\n at
> System.DirectoryServices.DirectoryEntry.get_Native Object()\r\n at
> AdminBuros.DAL.LDAPAuthentication.IsAuthenticated( String domain, String
> username, String pwd) in
> c:\\administracionburos\\dal\\adminburos.dal\\ldap authentication.cs:line

38"
>
> If I try with an invalid AD account/password, arises another exception:
>
> "System.Runtime.InteropServices.COMException (0x8007052E): Logon failure:
> unknown user name or bad password\r\n at
> System.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)\r\n at
> System.DirectoryServices.DirectoryEntry.Bind()\r\n at
> System.DirectoryServices.DirectoryEntry.get_Native Object()\r\n at
> AdminBuros.DAL.LDAPAuthentication.IsAuthenticated( String domain, String
> username, String pwd) in
> c:\\administracionburos\\dal\\adminburos.dal\\ldap authentication.cs:line

38"
>
>
> My environment is a development environment, AD in a Windows 2000 Server

and
> my ASP.NET application running in XP Pro SP2 machine. The <processmodel>
> setting in machine.config is configured to : SYSTEM.
> The setting :
> <identity impersonate="true" />
> is present in my web.config file.
>
> The IIS virtual directory is configured as an IIS application with :
>
> -Execute Permissions : Script Only
> -Application Protection : Medium (Pooled)
> -Authentication Methods:
> * Anonymous Access, configured with a valid domain account. The MSDN

article
> I mentioned does not specify if this account could be a domain or local
> account, just that it has to be a less privileged account.
> * Integrated Windows Authentication
>
> The code from the MSDN article was copied to a C# class type .NET project,
> which in turn is called by an ASP.NET web form which makes a project type
> reference to the class project.
> I've not tried the code from a windows form application however.
>
> Can somebody give me a hint about what's happening?
>
> Best regards.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best practices for using forms authentication and security in a hosted env (was: Re: Using a Forms authentication in a shared hosting environment) JEFF ASP .Net 1 11-12-2007 07:00 PM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
Forms Authentication with Active Directory LDAP Problem Tdar ASP .Net 2 10-11-2005 08:52 PM
Failed forms authentication with LDAP =?Utf-8?B?TGlubyBHYXJjaWE=?= ASP .Net 0 09-30-2005 07:01 PM
Forms Authentication question: How to have some pages open and some requiring forms authentication Eric ASP .Net 2 02-13-2004 02:14 PM



Advertisments