Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Forms authentication with Active Directory

Reply
Thread Tools

Forms authentication with Active Directory

 
 
=?Utf-8?B?TGlubyBHYXJjaWE=?=
Guest
Posts: n/a
 
      10-03-2005
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
 
 
 
 
Pat
Guest
Posts: n/a
 
      10-04-2005
Lino i have been using Forms Auth with AD and its been working well for me
after some struggles with it(What i had to change
in the MSDN code was that it couldn't retrieve GROUPS but it can
authenticate)
HAve you set the right Authentication mode in the IIS for the Directory..
Make sure it has Windows Auth and try again..
If problem still persist let me know..
PAtrick

"Lino Garcia" <> wrote in message
news:79098DA3-8917-4603-B94A-...
> 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 Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms Authentication with Active Directory BigSam ASP .Net Security 3 09-03-2007 07:50 PM
Forms Authentication - Active Directory oriol.ardevol@gmail.com ASP .Net Security 5 06-11-2007 02:37 PM
Asp.Net Forms authentication using Active Directory Egbert ASP .Net Security 1 11-03-2004 03:02 PM
Forms Authentication and Active Directory - Steve - ASP .Net 7 06-04-2004 09:32 PM
Forms Authentication with Active Directory using vb.net PLam ASP .Net Security 2 04-09-2004 01:53 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57