Has anyone attempted to bind and gather user information from eDirectory? We are a Netware shop and I have an ASP page that can check UID and password pairs for authentication, but I want to take it a step further and restrict Intranet access based on eDirectory rights and I can't find anything.
So far, I use the following code to validate the UID and password pair and write a cookie that grants access to the rest of the Intranet site:
Dim retCode, entry
Dim gotTreeName, gotndsName, gotPassword, ndsName
Set NWDir1=server.createobject("NWDirLib.NWDirCtrl.1"
gotTreeName=Request.Form("treeName"
gotndsName=Request.Form("ndsName"
gotPassword=Request.Form("password"
On Error Resume Next
NWDir1.FullName="NDS:\\" & gotTreeName & "\[Root]"
ndsName= NWDir1.FullNameFromTreeAndContext(gotTreeName, gotndsName)
response.write "Verifying password for object:<p> "
response.write "<FONT COLOR=blue>" & ndsName & "</FONT><p>"
set entry=NWDir1.FindEntry(ndsName)
If entry is nothing Then
response.write "Error " & str(err.number) & ", " & err.description & "<br>"
response.write "Object not found !" & "<BR>"
Else
retCode=entry.ValidatePassword(gotPassword)
If retCode=TRUE Then
response.cookies ("logon"
= "authorized"
response.redirect "tcda-home.asp"
Else
response.cookies ("logon"
= "unauthorized"
response.write "<FONT COLOR=red>" & ("*** LOGIN FAILED ***<BR>"
& "</FONT>"
End If
End If
Set NWDir1=Nothing
End If
If y'all know of something newer - or perhaps somthing that can expand upon what I have, it would be greatly appreciated.
Thanks
Butkus
So far, I use the following code to validate the UID and password pair and write a cookie that grants access to the rest of the Intranet site:
Dim retCode, entry
Dim gotTreeName, gotndsName, gotPassword, ndsName
Set NWDir1=server.createobject("NWDirLib.NWDirCtrl.1"
gotTreeName=Request.Form("treeName"
gotndsName=Request.Form("ndsName"
gotPassword=Request.Form("password"
On Error Resume Next
NWDir1.FullName="NDS:\\" & gotTreeName & "\[Root]"
ndsName= NWDir1.FullNameFromTreeAndContext(gotTreeName, gotndsName)
response.write "Verifying password for object:<p> "
response.write "<FONT COLOR=blue>" & ndsName & "</FONT><p>"
set entry=NWDir1.FindEntry(ndsName)
If entry is nothing Then
response.write "Error " & str(err.number) & ", " & err.description & "<br>"
response.write "Object not found !" & "<BR>"
Else
retCode=entry.ValidatePassword(gotPassword)
If retCode=TRUE Then
response.cookies ("logon"
response.redirect "tcda-home.asp"
Else
response.cookies ("logon"
response.write "<FONT COLOR=red>" & ("*** LOGIN FAILED ***<BR>"
End If
End If
Set NWDir1=Nothing
End If
If y'all know of something newer - or perhaps somthing that can expand upon what I have, it would be greatly appreciated.
Thanks
Butkus