Subject: How Can I use the login Domino to ASP programm or how can I export LDAP from Domino to LDAP ASP
Hi Roger,
So let me make sure I understand what you are trying to do.
-
You want to use domino security for your asp applications, right?
-
You would also like to use domino as a front end for allowing users to access a particular web page or site, right?
Option 1. If this is the case the best way is to use ldap for authenication. If you receive a successful login then allow them to go to the next page.
Option 2. You would build a custom login using the domcfg template on your server but I think option 1 would do the trick.
I am not a expert in ASP programming but I thought I would take a shot at it and here is what I came up with. Not pretty but it works.
This code is designed to preform a domino ldap lookup and can also be used for authenication.
You will need:
IP works -installation required
-
http://www.nsoftware.com/default.aspx
-
Click on Platforms / IDEs → ASP
-
Select IP*Works!V6 ASP Edition
-
Trial version will work.
Let me know if it works for you.
Ted Ford
ewizard2@cox.net
<tr><td>LDAP Server: <td><input type="text" name="server" value="mcd01" size="30">
<tr><td>Query:<td><input type="text" name="query" value="" size="50">
<tr><td>Pass:<td><input type="password" name="myPassword" size="50">
<tr><td><td><input type="submit" value="Search!">
<%
If Request(“REQUEST_METHOD”) = “POST” Then
Dim ldap
Set ldap = Server.CreateObject(“IPWorksASP6.LDAP”)
ldap.ServerName = Request.Form(“server”) 'LDAP Server Name from Request form
ldap.SearchSizeLimit = 100
'at most 100 results
password = Request.Form(“myPassword”)
'retrieving password from request form
username = Request.Form(“query”)
'retrieving username from request form
if ( password = "" ) then
password = "nopassword"
end if
if ( username = "" ) then
username = "no user"
end if
ldap.dn = username
'User name used for Ldap session
ldap.password = password
'password used for Ldap session
ldap.bind
'establishing a session with ldap.
’ if result code is 0 and description is OK then you have a successful login. If result code is 49 and description
’ is "Invalid Credentials, then you will be bounded as anonymous
if ldap.NextResult = 0 then
’ if result code is 0 and description is ok = sucessful login
if ldap.ResultDescription = “[ok]” then
Response.Write(“it worked”)
’ set the required attributes
ldap.AttrCount = 1
ldap.AttrType(0) = “mail”
'email for addresses etc…
ldap.Search “cn=” & Request.Form(“query”)
While ldap.NextResult = 1
'1 is a search result
Response.Write "
Found Name: " & ldap.ResultDN & Chr(13) & Chr(10)
Response.Write "
Found Email: " & ldap.AttrValue(0) & Chr(13) & Chr(10)
Wend
else
Response.Write(“Not Authorized”)
end if
end if
’ Response.Write(“
” & ldap.ResultCode)
’ use the above statement to see result code
Response.Write “”
End If
%>