Orsu
Orsu

Reputation: 417

Windows Authentication - Allow anyone

In an ASP.NET, C# application, i'd like to get the user's login. So i set up windows authentication, and because it's ONLY to get the login, i allowed (i think ?) anyone.

    <anonymousIdentification enabled="false"/>
<authentication mode="Windows" />
<identity impersonate ="true"/>
<authorization>
  <allow users="*"/>
  <deny users="?"/>
</authorization>

And locally, it was working as i expected, the user wasn't getting any form requesting credentials or something, but when i deployed my project to a distant IIS, even with anonymous login disabled, impersonation enabled, and the same config file, it asks the credential

why :(

EDIT : to be more precise, my website is an intranet, and isn't supposed to ever get out of local network.

Upvotes: 0

Views: 2342

Answers (1)

WorkSmarter
WorkSmarter

Reputation: 3808

When the user browses to the website, their credentials are used to execute the application. Since the Window's users do not have the necessary permissions on the remote server, they are receiving the enter your credential screen.

Microsoft reference

When impersonation is enabled, only your application code runs under the context of the impersonated user.

How to fix the problem?

Set impersonate to "false"

Upvotes: 1

Related Questions