views:

228

answers:

3

i have an intranet app asp.net mvc site. is there anyway to capture the windows nt login from the user wihtout having a full login system in the site. i dont want permissioning but i would like to do some logging on the server to track requests, etc . .

A: 

If you set IIS to use Windows Authentication and the site is in the Intranet Zone for your clients then the logins will automatically happen without any prompts at all.

blowdart
A: 

What version of Windows is this mvc app running on?

You could try the following:

  • Use IIS Manager to disable anonymous access to the site, and make sure digest and/or windows authentication is enabled.
  • Change the mvc app's web.config to use Windows Authentication
  • Access the login name in the controller using User.Identity.Name.

Would that do?

IanT8
+2  A: 

You can use HttpContext.Current.User.Identity.Name if you set up the site to use Windows Authentication. Many browsers will pass the username on transparently.

Dan Diplo
it seems with firefox, it prompts for a user name / pwd even though IE seems to not require it . . any ideas on why this is happenning
ooo
Dan Diplo - any ideas ?
ooo
FireFox, by default, doesn't pass on the username. However, it can be made to work - see http://markmonica.com/2007/11/20/firefox-and-integrated-windows-authentication/
Dan Diplo