473,320 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

authentication issue


Hi, I have been stuck on something for a few days ... I
have some code that is working on a domain controller but
not a member server (running on a DC is not an option, so
I must get it to work on the member server). I figured no
problem, I will just provide domain user credentials in my
code .... well, it has not been so easy. I run into one
of two problems, when I don't provide credentials (when
running on the member server) I get:

Provider (0x80004005)
Unspecified error

when I do provide credentials, I get:

Provider (0x80040E09)
Permission denied.

Can someone tell what I am doing wrong ... or perhaps show
me another way to do this? Thanks in advance.

- doug

---------------------------------------
<%

sUserAccountName = "user10"

Dim oRootDSE
Set oRootDSE = GetObject ("LDAP://rootDSE")
sADsPath = oRootDSE.Get("defaultNamingContext")
Set oRootDSE = Nothing

<!--END CALLOUT A-->
<!--BEGIN CALLOUT B-->

Dim oConnection, oCommand, oRecordSet
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Provider = "ADsDSOObject"
'oConnection.Properties("User ID") = "user1"
'oConnection.Properties("Password") = "pass"
'oConnection.Properties("Encrypt Password") = True

oConnection.Open "Active Directory Provider"
Set oCommand = CreateObject("ADODB.Command")
Set oCommand.ActiveConnection = oConnection
oCommand.CommandText = _
"SELECT samAccountName,mail,displayname,userprincipalname
FROM 'LDAP://" & _
sADsPath & "'" & "WHERE samAccountName ='" & _
sUserAccountName & "' AND objectCategory='Person'"

Set oRecordSet = oCommand.Execute
If not oRecordSet.EOF Then
Response.Write oRecordSet.Fields("mail") & "<BR><BR>"
Response.Write oRecordSet.Fields("userprincipalname") &
"<BR><BR>"
Response.Write oRecordSet.Fields("displayname") & "<BR><BR>"
End If
oConnection.Close
Set oConnection=Nothing
Set oCommand=Nothing
Set oRecordSet=Nothing

%>
Jul 19 '05 #1
2 4381
"Doug Partridge" <douglas_partridge@_nospam_.yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

Hi, I have been stuck on something for a few days ... I
have some code that is working on a domain controller but
not a member server (running on a DC is not an option, so
I must get it to work on the member server). I figured no
problem, I will just provide domain user credentials in my
code .... well, it has not been so easy. I run into one
of two problems, when I don't provide credentials (when
running on the member server) I get:

Provider (0x80004005)
Unspecified error

when I do provide credentials, I get:

Provider (0x80040E09)
Permission denied. You should make sure that your IWAM and your IUSR account have sufficient
privilige to access the active directory. Since these accounts default to
the local accounts database, they have not been granted access to the LDAP
database. So this requires resetting the IWAM & IUSR account
You can change them using the scripts in \inetpub\adminscripts\adsutil.vbs

An other, less efficient trick is to authenticate in code and not to use
anonymous LDAP connections...

Can someone tell what I am doing wrong ... or perhaps show
me another way to do this? Thanks in advance.

- doug

---------------------------------------
<%

sUserAccountName = "user10"

Dim oRootDSE
Set oRootDSE = GetObject ("LDAP://rootDSE")
sADsPath = oRootDSE.Get("defaultNamingContext")
Set oRootDSE = Nothing %>


Jul 19 '05 #2
Egbert,

Thanks for responding. I will look into the ADSUTIL option. You mentioned
that a less efficient option is authenticating via the code. I was
attempting to do this but could never successfully run the code. I would
like to know how to do this, or at least what I was doing incorrectly. Do
you have a code sample that might help (or show me using the code I
submitted in my original post)? Thanks, Doug

"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:OD**************@TK2MSFTNGP10.phx.gbl...
"Doug Partridge" <douglas_partridge@_nospam_.yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

Hi, I have been stuck on something for a few days ... I
have some code that is working on a domain controller but
not a member server (running on a DC is not an option, so
I must get it to work on the member server). I figured no
problem, I will just provide domain user credentials in my
code .... well, it has not been so easy. I run into one
of two problems, when I don't provide credentials (when
running on the member server) I get:

Provider (0x80004005)
Unspecified error

when I do provide credentials, I get:

Provider (0x80040E09)
Permission denied.

You should make sure that your IWAM and your IUSR account have sufficient
privilige to access the active directory. Since these accounts default to
the local accounts database, they have not been granted access to the LDAP
database. So this requires resetting the IWAM & IUSR account
You can change them using the scripts in \inetpub\adminscripts\adsutil.vbs

An other, less efficient trick is to authenticate in code and not to use
anonymous LDAP connections...

Can someone tell what I am doing wrong ... or perhaps show
me another way to do this? Thanks in advance.

- doug

---------------------------------------
<%

sUserAccountName = "user10"

Dim oRootDSE
Set oRootDSE = GetObject ("LDAP://rootDSE")
sADsPath = oRootDSE.Get("defaultNamingContext")
Set oRootDSE = Nothing

%>

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rob Mayo | last post by:
What I'm trying to do is Create an ASP.Net app that has both Windows-authenticated users and Anonymous users. The idea is this: When authenticated users attempt to access the site, their...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
4
by: Chris Gatto | last post by:
Hi, I'm having what should be a minor problem but has turned into a 2 day slug fest with ASP.Net. I am simply attempting to authenticate my asp.net application users against users in an AD...
2
by: Maziar Aflatoun | last post by:
Hi guys, I'm using Windows authentication to connect to SQL Server 2000. On my computer the connection is fine. Now if I move it to a remote server, how to I hard code my Username/Password in...
5
by: Cesar | last post by:
Hello, I have an application that is using forms authentication and it seems to be working fine most of the time. Unfortunatelly, it sometimes just redirects me to the login screen. It seems that...
6
by: eric.olstad | last post by:
I'm pullin my hair out here. I've created a login page that uses Forms Authentication. Initially, it loads the types of authentication methods from a database and asks the user to select the auth...
2
by: Matt | last post by:
I am getting the following Error. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific...
18
by: troywalker | last post by:
I am new to LDAP and Directory Services, and I have a project that requires me to authenticate users against a Sun Java System Directory Server in order to access the application. I have found...
4
by: =?Utf-8?B?R3V1czEyMw==?= | last post by:
Hi, I created a web site on a remote server. To logon the user must enter a user id and password. The site is uses Forms Authentication. The web config file looks as follows: ...
0
by: embeddedbob | last post by:
Hi there, I appreciate any help on the following issue. I can't seem to find any other similar topic. (CS4, ActionScript 3.0, Flash 10) I have a SWF embedded within a page that is protected by...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.