3

I'm using windows authentication mode in my asp.net app. If a user is logged correctly in windows he can access to my site without logins. But if is an external user when he try to access to asp.net app, a logon dialog box is showed. I don't want that logon is required.

I want the username only if the user is logged. but if the user is not logged i don't want to do anything.

oezi
  • 51,017
  • 10
  • 98
  • 115
Luca Romagnoli
  • 12,145
  • 30
  • 95
  • 157

2 Answers2

2

You need to use <authentication mode="Windows"/>, which it sounds like you are AND turn on anonymous access within the IIS configuration.

If they are currently logged in then it should pass their credentials. If they aren't then it should pick up the user that the worker process is running under.

You might see this question for a few more details: How to get Windows user name when identity impersonate="true" in asp.net?

Community
  • 1
  • 1
NotMe
  • 87,343
  • 27
  • 171
  • 245
1
<authentication mode="Windows"/> 
 <authorization>
         <deny users="?" />
 </authorization>

This web.config entry will redirect users to Access Denied page instead of showing the login prompt. Is this what you are looking for?

Shoban
  • 22,920
  • 8
  • 63
  • 107