Window authentication not working in MVC4

人走茶凉 提交于 2019-12-22 04:29:39

问题


Scenario

User A can access all pages in MVC4 website except one. But user B can access all pages (no restriction).

What I had done so far?

  1. Deployed website on IIS 7.5.
  2. Enabled window authentication and disabled Anonymous authentication for hosted website on IIS.
  3. Testing website.

Testing Results -

(1) When User B is logged on same system (development system) where the website is deployed, he can access the website without prompt dialog.

(2) But when same website is published on server (production system) with same settings, website still asks for credentials with pop up.

** Both of the development system and production system are in same domain (let's name it domain.com).

Question

Why is the same user in same domain is been asked for credentials by website?


回答1:


As per my research for Window Authentication, I want to conclude following lines (also as reference for me) -

(1) Window Authentication (abbrev. WA) will always show prompt for verifying users if you had configured WA properly.

See anonymous authentication disabled and windows authentication enabled in below snapshot.

(2) Even if one set NTLM as top provider than Kerberos (in IIS), the IIS will still ask for Window credentials. Snapshot show how to do that.

(3) If you want to avoid showing prompt on browser for WA, follow steps-

(a) Open IE browser --> Internet Options --> Security tab.

(b) Add site to Local Intranet zone so that browser will send logged-in username and password to IIS.

Note - The above points universally apply to MVC and ASP.NET.

Answer to my question Why is the same user in same domain is been asked for credentials by website?

Because I had set anonymous authentication enabled along with Window authentication on development system. (Silly mistake).



来源:https://stackoverflow.com/questions/22024896/window-authentication-not-working-in-mvc4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!