Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 8th, 2008, 07:11 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 209
Default retrieve windows login username?

I'm trying to retrieve the username of the user logged into a machine when a person visits my page on our intranet. I've looked over cfntauthenticate but that's not going to do what I need it to do.

Is this even possible with coldfusion or should I be looking to asp?
Reply
  #2  
Old July 8th, 2008, 08:16 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,596
Default

If you're using IIS and Integrated Windows Authentication, cgi.auth_user should be set to DOMAIN\username.
Reply
  #3  
Old July 8th, 2008, 08:41 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 209
Default

Quote:
Originally Posted by acoder
If you're using IIS and Integrated Windows Authentication, cgi.auth_user should be set to DOMAIN\username.
Yeah I turned on Integrated Windows Authentication and now I can get the username of the person logged in. I need to be able to retrieve a list of the groups the user is a member of on our active directory.

I'm trying to use th cfldap, but I'm not getting any data back:

Code:
<cfldap 
          server = "domain controller server"
          action = "query"
          name = "results"
          start = "dc=xxxx,dc=xxx"
          filter = "(&(objectclass=group)(name=Domain Admins))"
          attributes = "cn,ou,dn,mail,memberOf"
          sort = "cn ASC">
Is there a really simple cfldap query I can run to make sure I'm making the connection to the server?

Last edited by acoder; July 9th, 2008 at 09:33 AM. Reason: Added [code] tags
Reply
  #4  
Old July 9th, 2008, 09:46 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,596
Default

See if this tutorial helps.
Reply
  #5  
Old July 9th, 2008, 01:29 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 209
Default

Quote:
Originally Posted by acoder
See if this tutorial helps.
That helps give me some info, I think I need to have a better understanding of how to query LDAP, I think that might be where my problem is.
Reply
  #6  
Old July 9th, 2008, 04:23 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,596
Default

If you haven't already, also check out the reference. You could test with a public server (emailman has some useful info.).
Reply
  #7  
Old July 9th, 2008, 04:56 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 209
Default

Quote:
Originally Posted by acoder
If you haven't already, also check out the reference. You could test with a public server (emailman has some useful info.).
I'm able to query LDAP for info, but I can't seem to get the data I'm looking for.

I want to either check if a user is a member of a particular group, or at least retrieve all the groups a user is a member of, whichever one I can do.
Reply
  #8  
Old July 10th, 2008, 09:43 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,596
Default

Now, it's just an LDAP problem, not necessarily Coldfusion.

I'd say that a basic LDAP tutorial might help. Check this Wikipedia page and the external links.
Reply
  #9  
Old July 10th, 2008, 04:31 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 209
Default

Quote:
Originally Posted by acoder
Now, it's just an LDAP problem, not necessarily Coldfusion.

I'd say that a basic LDAP tutorial might help. Check this Wikipedia page and the external links.
I ended up figuring it out. Here's what my cfldap looks like:

[code=html]
<cfldap
server = "Domain Controller"
action = "query"
name = "results"
start = "DC=ha2000,DC=com"
filter="samAccountName=#form.name#"
attributes="cn,displayname,title,mail,member,membe rof"
username="xxxxxx"
password="xxxxxxx"
sort = "memberof ASC">
[/code]
Reply
  #10  
Old July 10th, 2008, 06:45 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 12,596
Default

Glad you got it working. Thanks for posting.
Reply
  #11  
Old July 10th, 2008, 09:04 PM
Member
 
Join Date: Mar 2007
Posts: 101
Default

for future, you can download Softerra LDAP Browser (free version) and tweak your filter as much as you like without it being too much of a pain
Reply
  #12  
Old July 18th, 2008, 05:02 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 209
Default

Quote:
Originally Posted by developing
for future, you can download Softerra LDAP Browser (free version) and tweak your filter as much as you like without it being too much of a pain
Thanks for that info, I've got Softerra LDAP Browser now, it's how I've been figuring out what fields I can retrieve now.
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles