469,280 Members | 1,823 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,280 developers. It's quick & easy.

retrieve windows login username?

219 100+
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?
Jul 8 '08 #1

✓ answered by dmorand

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:

Expand|Select|Wrap|Line Numbers
  1. <cfldap 
  2.           server = "Domain Controller"
  3.           action = "query"
  4.           name = "results"
  5.           start = "DC=ha2000,DC=com"
  6.           filter="samAccountName=#form.name#"
  7.           attributes="cn,displayname,title,mail,member,memberof"    
  8.           username="xxxxxx"
  9.           password="xxxxxxx"
  10.           sort = "memberof ASC">
  11.  

11 8789
acoder
16,027 Expert Mod 8TB
If you're using IIS and Integrated Windows Authentication, cgi.auth_user should be set to DOMAIN\username.
Jul 8 '08 #2
dmorand
219 100+
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:

Expand|Select|Wrap|Line Numbers
  1. <cfldap 
  2.           server = "domain controller server"
  3.           action = "query"
  4.           name = "results"
  5.           start = "dc=xxxx,dc=xxx"
  6.           filter = "(&(objectclass=group)(name=Domain Admins))"
  7.           attributes = "cn,ou,dn,mail,memberOf"
  8.           sort = "cn ASC">
  9.  
  10.  
Is there a really simple cfldap query I can run to make sure I'm making the connection to the server?
Jul 8 '08 #3
acoder
16,027 Expert Mod 8TB
See if this tutorial helps.
Jul 9 '08 #4
dmorand
219 100+
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.
Jul 9 '08 #5
acoder
16,027 Expert Mod 8TB
If you haven't already, also check out the reference. You could test with a public server (emailman has some useful info.).
Jul 9 '08 #6
dmorand
219 100+
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.
Jul 9 '08 #7
acoder
16,027 Expert Mod 8TB
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.
Jul 10 '08 #8
dmorand
219 100+
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:

Expand|Select|Wrap|Line Numbers
  1. <cfldap 
  2.           server = "Domain Controller"
  3.           action = "query"
  4.           name = "results"
  5.           start = "DC=ha2000,DC=com"
  6.           filter="samAccountName=#form.name#"
  7.           attributes="cn,displayname,title,mail,member,memberof"    
  8.           username="xxxxxx"
  9.           password="xxxxxxx"
  10.           sort = "memberof ASC">
  11.  
Jul 10 '08 #9
acoder
16,027 Expert Mod 8TB
Glad you got it working. Thanks for posting.
Jul 10 '08 #10
developing
110 100+
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
Jul 10 '08 #11
dmorand
219 100+
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.
Jul 18 '08 #12

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by dave | last post: by
reply views Thread by JIM.H. | last post: by
1 post views Thread by CodeRazor | last post: by
8 posts views Thread by Mike P | last post: by
reply views Thread by avnaresh | last post: by
3 posts views Thread by =?Utf-8?B?Sm9zZXBo?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.