473,499 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

LDAP ASP Authentication

williak
1 New Member
Hi I am new to this forum so if I make a mistake in protocol let me know.
OK I have been asked to convert my existing ASP application to make users authenticate with our LDAP servers before starting the application. I have Google'd LDAP and ASP until my eyes hurt, looking for the correct procedure to do a user lookup from ASP.
The platforms are Server:win2000/20003, clients:win2K and winXP
I am hoping to eventually put a standard type login form up on the web site and validate from that.
To get started I thoguht I would grab a script that just browsed the LDAP tree just to test that the connection would work. It didn't I got the results below :(


I have coded a basic file to begin the process but am stuck on a particular line which brings back the error '80072020 which seems to be saying something wrong with the formatting. Here is the script its falling over on line 13.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
</head>
<body>
<%

strUsername = request.queryString("user")
strUserName = Right(strUserName, Len(strUserName) - InStrRev(strUserName, "\"))
Response.Write("Username="&strUserName)

** Failing Line
Set objDomain = GetObject ("LDAP://stockcoll.ac.uk/dc=stockcoll,dc=ac,dc=uk,OU=Staff,OU=Technology Services/")
****
objADsPath = objDomain.Get("defaultNamingContext")
Set objDomain = Nothing
Set con = Server.CreateObject("ADODB.Connection")
con.provider ="ADsDSOObject"
con.open "Active Directory Provider"
Set Com = CreateObject("ADODB.Command")
Set Com.ActiveConnection = con
Com.CommandText ="select memberof FROM 'LDAP://"+objADsPath+"' where sAMAccountname='"+strUsername+"'"
Set rs = Com.Execute
membership=rs("memberof")
rs.Close
con.Close
Set rs = Nothing
Set con = Nothing
For each group in membership
newgroup=split(group,"=")
response.write left(newgroup(1), len(newgroup(1))-3)&"<br>"
Next
%>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
</body>
</html>

Do I need to Bind to the LDAP database as well, I got to thinking there must be some security involved somewhere.
I have seen some solutions using ASP.NET so I am not bothered whether I use that or not.

Cheers

Kev
Jul 26 '07 #1
0 2135

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2853
by: dmcconkey | last post by:
Hi folks, I've been searching for a while and haven't found my specific question anywhere else. If this has already been asked, please accept my appologies and point me to the appropriate...
0
1797
by: Ronald Wunderlich | last post by:
Hi, My first Question: can db2 (db2ckpw) ask over pam_ldap my edirectory ldap server for user authentication? The scenario: 1. computer suse linx enterprise server 8(SLES8) and edirectory...
3
16418
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
1
2065
by: Serge | last post by:
Good Day Folks, I'm still trying to write a class to do LDAP searches on a Novell eDirectory. I've yet to see anything that even compiles, this includes samples from MSDN. Amazing. I...
6
2992
by: Notgiven | last post by:
I am considering a large project and they currently use LDAP on MS platform. It would be moved to a LAMP platform. OpenLDAP is an option though I have not used it before. I do feel fairly...
4
6554
by: Terry Miller | last post by:
I have DB2 V8.2 loaded on a Redhat Enterprise Linux version 3 (RHEL 3) box. RHEL is configured to talk to LDAP for authenticaton besides the local passwd file. I can verify this by executing an su...
2
3229
by: duncan beaumont | last post by:
Hi, - SQLserver 2000 - Yellowfin 2.4 - Windows 2003 server I have been asked to investigate seting up LDAP authentication to access our Yellowfin reporting.
0
2031
by: jayadevi | last post by:
Is it possible to configure an IIS to do both LDAP authentication and Windows authentication? For ex: Suppose one application of server A is hosted in IIS. The requests come from two different...
3
4019
by: RJN | last post by:
Hi I've written a code that queries Windows LDAP server and works fine, but the same doesn't work when querying Solaris LDAP server. DirectoryEntry de = new...
1
2890
by: jesbuddy07 | last post by:
Hello, I'm using IIS 5 and PHP 4.3.5. I have an html page, page1, that resides at member.company.com server. It contains a form asking a user to login. I then check the login by connecting to...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.