Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
What do you mean by "doesn't work"?
http://www.catb.org/esr/faqs/smart-questions.html#beprecise
--
Adam
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Thanks for your reply.
Why does it work on my Windows 7 setup with IIS7 set to Windows Authentication?
Copy link to clipboard
Copied
That's a great question. And let me be clear, I am not an expert on this by any means. I just recall trying to use Windows Authentication in the past and the cgi.remote_user variable was not populating for me. When I switched to basic authentication, viola, it started being populated.
Copy link to clipboard
Copied
Problem Solved - <cfoutput>#GetAuthUser()#</cfoutput> works with Windows authentication.
Windows authentication needs to be set on the top level.
I had anonymous on the top level and Windows authentication in folders below.
Fix - turn on both anonymous and Windows authentication on the top level in IIS.