Username and password from web based authentication

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139