Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Bart Lemmens #1
Username and password from web based authentication
Hello,
I'm using web based authentication to protect some web pages.
The user-id's and passwords are stored in Active Directory.
I need the user-id an password from the web based authentication
to launch an LDAP Query.
Can someone provide me code to use the user-id and the password in the LDAP
Query?
I tried cflogin.username and cflogin.password, but I can't get it to work.
----------------------------- Example LDAP Query -----------------------------
<cfldap action="query"
name="results"
start="dc=xxx,dc=xxx,dc=xxx"
attributes="sn,givenname,department,telephoneNumbe r,mobile,mail"
filter="(&(objectclass=*)(Company="xxx"))"
sort="sn"
server="xx.xx.xx.xx"
username="#cflogin.username#"
password="#cflogin.password#">
Bart Lemmens Guest
-
username and password
Hi all, My website host moved my site onto bigger servers and my ftp usermane and password had to be changed. Apparently the Contribute software... -
password/username
i have figured out how to "insert record' and when i fill in the text areas the page inserts the names into my database labeled passwords. what i... -
Trying to automate web site interaction that requires username and password authentication
Hi everyone, I've searched and searched for an answer with no luck. I'm trying to automate interaction with a secure web site to retrieve some... -
Username, Password, Pin
Hi, I would like to make a password protected page, whereby the user enters their username, password and pin. When the click the submit button, it... -
How to Add Username/Password for SMTP Authentication in MIME::Lite?
Is it possible to use MIME::Lite using a SMTP server that needs authentication? My provider now demands authentification when sending mail via... -
MikerRoo #2
Re: Username and password from web based authentication
You need to use:
username="#cflogin.name#"
password="#cflogin.password#">
If you roll a login form it needs to use the magic form names j_username and
j_password.
More info is at
[url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/[/url]
wwhelp.htm?context=ColdFusion_Documentation&file=0 0000287.htm.
Regards,
-- MikeR
MikerRoo Guest
-
Bart Lemmens #3
Re: Username and password from web based authentication
Currently the code is in application.cfm.
How can I use the content of these variables in other cfm files in the same
map?
For example to query the ldap server and provide a list of users and telephone
numbers (list.cfm)?
Bart Lemmens Guest
-
MikerRoo #4
Re: Username and password from web based authentication
There are two main uses of LDAP in this context.
1) Inside a CFLogin tag, pass the user's name and password to the LDAP server
in a bind-only operation. You typically don't (or even can't) return results
-- you are just learning if the user authenticates.
When you use LDAP for auth, you should have the login page posted with SSL and
you should connect to the LDAP server using SSL (if your server supports it).
2) To search an LDAP directory, you usually do not use a username or password
at all. If you do, it is a special account provided by your LDAP admin, not
the user's account. (Often the user can bind but not query).
Anyway, your question seems to have changed. You need to clarify a little
more.
Do you want to authenticate a user, or query the directory, or both? Do not
try to do both with the same LDAP call.
The results of your LDAP call are available in the query you specify with the
name attribute. In this case, you used "results". So you can use the code:
<CFDUMP var="#Results#"> to see what was returned. Use this query like any
other.
Do you want to preserve the username outside of the cflogin tag? The
password (not a good idea)?
For your list of telephone numbers, create a new LDAP call (in list.cfm
perhaps) and do not use a username and password unless your ldap admin requires
it.
-- MikeR
MikerRoo Guest



Reply With Quote

