p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 5th, 2009, 11:05 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default login page that authenticates against ldap

Hi, I hope someone can help me. I have search on the web for days and post on several forums without any luck.

I have a form build in classic ASP, that is trying to authenticated against LDAP in a different server than where the form is located.

If the users exist they will be redirected to a new page. if not they will be prompt to try again for username and password.

I have read that I need to have anonymous log in disabled for this to work, which I have done.

As of right now, I always get authentication failed.

the form i am working with is this


<%
Option Explicit
Response.Buffer = True

'// 1. Form Validation
Dim Submit, UserName, Password, Domain, Result, Message
Submit = Request.Form("Submit")

If Submit = "Authenticate" Then

'Get the input from your HTML form
UserName = Request.Form("UserName")
Password = Request.Form("Password")
Domain = Request.Form("Domain")

'Call the AuthenticateUser() function to do the verification process
Result = AuthenticateUser(UserName, Password, Domain)

If Result Then
'If user exist, then redirect to success page
Response.Redirect ("success.asp")
Else
'If user don't exist, redirect to error page
Response.Redirect ("error.asp")
End If
End If

'// 2. Authenticate Function
Function AuthenticateUser(UserName, Password, Domain)
Dim strUser, strPassword, strQuery, oConn, cmd, oRS

'Assume Failure
AuthenticateUser = false
strUser = UserName
strPassword = Password

strQuery = "SELECT cn FROM 'LDAP://" & Domain & "' WHERE objectClass='*'"
Set oConn = server.CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOOBJECT"
oConn.Properties("User ID") = strUser
oConn.Properties("Password") = strPassword
oConn.Properties("Encrypt Password") = true
oConn.open "DS Query", strUser, strPassword

Set cmd = server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = oConn
cmd.CommandText = strQuery

On Error Resume Next
Set oRS = cmd.Execute

If oRS.bof OR oRS.eof Then
AuthenticateUser = False
Else
AuthenticateUser = True
End if

Set oRS = Nothing
Set oConn = nothing
End Function
%>

<html>
<head>
<title>Using Microsoft Active Directory Authentication</title>
</head>
<body>

<form name="DomainAuthentication" method="post">
Username:<input type="text" name="UserName" size="45">
Password:<input type="password" name="Password" size="45">
AD Domain:<input type="text" name="Domain" size="45">
<input name="submit" type="submit" value="Authenticate">
</form>

</body>
</html>



Edit/Delete Message
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 5th, 2009, 02:38 AM
Registered User
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Sep 2009
Location: Lucknow, UP
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In VB6 how can a picturebox control be set to a picture property?
Picturebox1.Picture=?

in VB .NET it can be set by
picturexox1.Image.FromFile("Image_file_Path") but in Vb6 there is no any ather method to assign a image to a picturebox control at run time. Pl help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Login page back to original page pablohoney Classic ASP Basics 1 October 3rd, 2006 08:09 PM
Please Help! Login page AndyC5279 ASP.NET 2.0 Basics 9 September 13th, 2006 07:42 AM
LOGIN PAGE (does not link to the next page) jim.sullivan@telus.net Classic ASP Databases 7 April 5th, 2006 02:28 PM
Help Using LDAP user authentication in ASP page dreamzentrue Classic ASP Basics 0 November 11th, 2005 01:33 PM
Newbie Help. Login to unique login page per user Kainan Classic ASP Professional 10 May 3rd, 2005 08:47 AM



All times are GMT -4. The time now is 07:02 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc