473,383 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 9257
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

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

Similar topics

1
by: dave | last post by:
Hi I'm writing one asp page and developing application for intranet... I just need to know when if anyone executes this scripts, i need to find out his windows login information (only username on...
2
by: bob | last post by:
hi, I want to redirect my user to another page. With ASP (not .Net) and IIS 5.0, under windows 2000 server. We have installed the component WinHTTP that is used to manipulate http requests. ...
0
by: vvenk | last post by:
Hello: I would like to know how I can programmtically retrieve the windows login id? This is a asp.net application. Thanks. venki
0
by: JIM.H. | last post by:
Hello, My connection string in config.web: <appSettings> <add key="connStr" value="workstation id=myServer;packet size=4096;user id=MyUser;data source=MYSERVER;persist security info=True;initial...
2
by: FayeC | last post by:
I have created a site in Joomla with a login (no self registration, users are provided with username and password by the admin). The users are supposed to login to a specific page where they can...
1
by: CodeRazor | last post by:
How can I retrieve the currently logged in user's username? I have tried the option below: Request.ServerVariables("LOGON_USER") while denying access to the Anonymous user both in the config and...
8
by: Mike P | last post by:
How do you get the Windows login and password of the person who is logged in? Is it possible? *** Sent via Developersdex http://www.developersdex.com ***
0
by: avnaresh | last post by:
i have a windows application in c#. i want to run it as windows login i.e at the starting of windows os instead of username and password it will run my application. is it possible?
3
by: =?Utf-8?B?Sm9zZXBo?= | last post by:
In a Winform application using VB.Net is there a way to capture the user's Windows login name? Any help would be greatly appreciated, thanks.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.