Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

ColdFusion GetAuthUser()

New Here ,
Sep 05, 2012 Sep 05, 2012

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>

2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 05, 2012 Sep 05, 2012

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

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

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2012 Sep 06, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 06, 2012 Sep 06, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2012 Sep 06, 2012

Thanks for your reply.

Why does it work on my Windows 7 setup with IIS7 set to Windows Authentication?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 06, 2012 Sep 06, 2012

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 08, 2012 Sep 08, 2012
LATEST

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.                                      

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources