Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ldap authentication

Status
Not open for further replies.

rexmike

Programmer
Joined
Aug 29, 2005
Messages
3
Location
KE
Hi everybody,im using a script i got from this forum for authenticating against the ldap server, it works well with iis running on an xp machine but when i try it on a iis running on a 2000 machine it fails,it returns an error and yet im sure the username and password are correct.
Any help will be highly appreciated
The script is as follows

<%@ Language=VBScript %>

<%


on error resume next
const ADS_SECURE_AUTHENTICATION=&h0001

oUsername="ilri\" & trim(Request.Form("username"))
oPassword=trim(Request.Form("password"))

Session ("loggedon")= Request.Form("username")
Session ("password") = oPassword

'reset session variable for application access
Session ("validuser") = 0
'by pass
'response.Redirect("validateDB.asp")


DN="LDAP://172.26.0.218:389/cn=users,dc=cgiarad,dc=org"
Set MyNamespace = GetObject("LDAP:")
Set X = MyNamespace.OpenDSObject(DN, oUserName, oPassword, ADS_SECURE_AUTHENTICATION)
if err.number=0 then

Session("AuthenticatedNetwork") = 1

response.Redirect("validateDB.asp")
else
Session("valid") = 1
response.Redirect("login.asp")
end if

Set MyNamespace = Nothing
Set X = Nothing
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top