Skip to main content
Participating Frequently
September 6, 2012
Question

ColdFusion GetAuthUser()

  • September 6, 2012
  • 1 reply
  • 2455 views

The GetAuthUser() function works on my workstation (Windows7 IIS7) and

doesn't work on my server (Server2008 IIS7 with Windows Authentication and Active directory)

Does anyone know why it's not working in the server environment?

Code used:

<cfoutput>#GetAuthUser()#<

/cfoutput>

This topic has been closed for replies.

1 reply

Inspiring
September 6, 2012

What do you mean by "doesn't work"?

http://www.catb.org/esr/faqs/smart-questions.html#beprecise

--

Adam

djpr0jectAuthor
Participating Frequently
September 6, 2012

After the user logs in to the test web page, the user name is not displayed on the web page in the server environment, only on the workstation configuration. The main difference between the two setups is the workstation doesn't have Active Directory and IIS7 for the workstation is windows authentication for the main directory - server is anonymous for the main directory and windows authentication for a folder which the getauthuser() is housed.

Miguel-F
Inspiring
September 6, 2012

As stated in the docs http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c57.html

This function works with cflogin authentication or web server authentication. It checks for a logged-in user as follows:

* It checks for a login made with cfloginuser.

* If no user was logged in with cfloginuser, it checks for a web server login (cgi.remote_user).

In order for the web server login way to work the directory needs to have the following Authentication setup on that folder in IIS to work:

Anonymous Authentication = disabled

Basic Authentication (with 401 challenge response) = enabled

When using Basic Authentication the username and password are transmitted in plain text so you should encrypt the connection by using SSL.

WIndows Authentication uses Kerberos which I don't think populates the cgi.remote_user variable which is what getauthuser() requires.

Message was edited by: Miguel-F Reworded the snippet about windows authentication