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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bind to Netware LDAP

Status
Not open for further replies.

butkus

MIS
Sep 4, 2001
114
US
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 &quot;Verifying password for object:<p> &quot;
response.write &quot;<FONT COLOR=blue>&quot; & ndsName & &quot;</FONT><p>&quot;
set entry=NWDir1.FindEntry(ndsName)
If entry is nothing Then
response.write &quot;Error &quot; & str(err.number) & &quot;, &quot; & err.description & &quot;<br>&quot;
response.write &quot;Object not found !&quot; & &quot;<BR>&quot;
Else
retCode=entry.ValidatePassword(gotPassword)
If retCode=TRUE Then
response.cookies (&quot;logon&quot;) = &quot;authorized&quot;
response.redirect &quot;tcda-home.asp&quot;
Else
response.cookies (&quot;logon&quot;) = &quot;unauthorized&quot;
response.write &quot;<FONT COLOR=red>&quot; & (&quot;*** LOGIN FAILED ***<BR>&quot;) & &quot;</FONT>&quot;
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top