Skip to main content
Inspiring
May 31, 2007
Answered

Passing login from Windows client

  • May 31, 2007
  • 7 replies
  • 1723 views
Is there any way to get the current user logged into a client (Windows XP), and pass those credentials into an ldap request?

Basically I want to create an Intranet site, where the users will automatically be authenticated from thier Windows login credentials already on the client.

Any help would be great.
Thank you.
-Christopher Keeler
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    chriskeeler2 wrote:
    > Is there any way to get the current user logged into a client (Windows XP), and
    > pass those credentials into an ldap request?
    >
    > Basically I want to create an Intranet site, where the users will
    > automatically be authenticated from thier Windows login credentials already on
    > the client.
    >
    > Any help would be great.
    > Thank you.
    > -Christopher Keeler
    >

    Yes there is a way. As long as we are talking Microsoft clients using
    Microsoft browsers connecting to a Microsoft network.

    .
    .
    .
    .
    .
    .
    .
    .


    Oh, you would like some hints on how?

    In IIS manager, select the resource(s) [website(s), folder(s) or
    file(s)] you would like to authenticate users in this manner and under
    the security tab in properties, edit the authentication method to use
    "Windows Integrated Authentication" and make user "Anonymous Access" is
    unchecked. When this is done, cgi.auth_user (or is it cgi.authuser)
    will be populated with the domain/userID of the logged on user of the
    client accessing the resource.

    This can then easily be used in a <CFLDAP ...> tag to retrieve Active
    Directory information about this user. This is how we use it on our
    intranet web site.

    <cfldap
    name="Entity" username="xxx" password="xxx"
    server="xxx"
    action="query" attributes="displayname,mail,sn,cn,givenName,..."
    scope="subtree" start="DC=smfbc,DC=org"
    filter =
    "(&(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=smfbc,DC=org)(samAccountName=#arguments.userid#))">

    We also use this bit of code to find out the machine name of the client
    accessing the resource.

    <cfexecute name="C:\WINDOWS\system32\nbtstat.exe" arguments="-A
    #cgi.REMOTE_HOST#" timeout="5" variable="nbtstat"/>

    7 replies

    Newsgroup_UserCorrect answer
    Inspiring
    May 31, 2007
    chriskeeler2 wrote:
    > Is there any way to get the current user logged into a client (Windows XP), and
    > pass those credentials into an ldap request?
    >
    > Basically I want to create an Intranet site, where the users will
    > automatically be authenticated from thier Windows login credentials already on
    > the client.
    >
    > Any help would be great.
    > Thank you.
    > -Christopher Keeler
    >

    Yes there is a way. As long as we are talking Microsoft clients using
    Microsoft browsers connecting to a Microsoft network.

    .
    .
    .
    .
    .
    .
    .
    .


    Oh, you would like some hints on how?

    In IIS manager, select the resource(s) [website(s), folder(s) or
    file(s)] you would like to authenticate users in this manner and under
    the security tab in properties, edit the authentication method to use
    "Windows Integrated Authentication" and make user "Anonymous Access" is
    unchecked. When this is done, cgi.auth_user (or is it cgi.authuser)
    will be populated with the domain/userID of the logged on user of the
    client accessing the resource.

    This can then easily be used in a <CFLDAP ...> tag to retrieve Active
    Directory information about this user. This is how we use it on our
    intranet web site.

    <cfldap
    name="Entity" username="xxx" password="xxx"
    server="xxx"
    action="query" attributes="displayname,mail,sn,cn,givenName,..."
    scope="subtree" start="DC=smfbc,DC=org"
    filter =
    "(&(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=smfbc,DC=org)(samAccountName=#arguments.userid#))">

    We also use this bit of code to find out the machine name of the client
    accessing the resource.

    <cfexecute name="C:\WINDOWS\system32\nbtstat.exe" arguments="-A
    #cgi.REMOTE_HOST#" timeout="5" variable="nbtstat"/>
    Inspiring
    May 31, 2007
    Sweeeet!

    Thanks for the code examples too!
    -CK
    Known Participant
    March 31, 2014

    I am thankful for this answer as it has partially solved my problem.

    when I go here:

    http://localhost/dir

    cgi.auth_user is populated and the page opens normal

    But, when I go here:

    http://localhost/dir/index.cfm

    I get an HTTP Error 401.2

    Basically, it seems the directory level is set up and working, but the file level is not.  I double checked that the file level security was set up the same as the directory security(like above) in IIS manager.  Anytime I try a file level url, I get the HTTP Error 401.2

    Any ideas?