简体   繁体   中英

Windows Authentication doesn't work with web application projects?

I am in the deployment phase of two separate asp.net 4.5 web applications being put onto a server running asp.net 4.6. We use a mixture of windows 7 and windows 10. All computers are on the same domain and the server is running IIS 8.5. This intranet application is supposed to use windows authentication to either send a user with invalid credentials to a web page with an error message or give the person access to the site. The problem is that some users are getting prompted to login regardless of security group that they belong to.

I have added the domain to the company wide whitelist and set internet explorer to use automatic windows authentication on intranet websites. We have tried moving the site to a non-shared folder. We finally tried converting both of the web applications to a web site project and the security worked just fine. However, we don't want to use web site projects anymore and find this to be a temporary solution.

I have made certain that authentication has been set to windows. When checking the IIS logs, I see the error codes 401 0 0 15 and 401 2 5 0. Maybe there is some other setting that we are overlooking when deploying? Any help would be greatly appreciated.



For your application to log in with your network's active directory, you need to configure windows authentication twice, the first one is from your application (Visual Studio) and the second one is in the IIS and you must convert the folder into an application and use the framework version correctly.

Visual Studio:
<system.web>
     <authentication mode = "Windows" />
</system.web>

IIS: Convert the folder to application by right clicking and "Convert to application", then select the application and go to the "Authentication" tab disable "Anonymous authentication" and enable "Windows authentication"

Greetings from Mexico.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM