ASP.NET MVC Windows Authentication displays a login prompt instead of a login

Based on this article , I created the base ASP.NET MVC site using the Visual Studio 2013 Intranet Site template with default settings and without changing anything.

When starting the site in debug mode, instead of logging in and displaying my domain\username I will be asked to enter my username / password in the Authentication Required dialog box.

I got the impression that since I have already been authenticated in the domain, I must be registered directly in the application using my AD account, without having to enter anything. When I try to explicitly enter my AD name or local user account, nothing is accepted.

EDIT

If I enter my username / password using Firefox, I am authenticated, but not with Chrome and IE.

Any ideas?

+7
authentication c # asp.net-mvc-4
source share
3 answers

What you come across is what disappointed me in Windows authentication for a long time. Internet explorer has a feature called pass-through authentication, which automatically authenticates you when using auth on Windows. Other browsers work around: https://addons.mozilla.org/en-US/firefox/addon/integrated-auth-for-firefox/ .

It is for sys administrators to implement these measures for other browsers, but no one ever does, so we are stuck in typing in our full usernames and passwords in every browser except IE.

What you can do is follow this approach: http://blogs.msdn.com/b/chunliu/archive/2010/09/21/creating-a-custom-login-page-for-windows-authentication.aspx

Not as simple as enabling windows auth or even implementing auth forms, but consider a scenario where you want the infrastructure to manage permissions and administer user accounts, or if you want to publish your login page globally without exposing AD.

+1
source share

IE will not transfer credentials to the site if it is not in the intranet security zone or in the same domain. You can add your site to the list of trusted IE sites using

 Internet Options > Security > Trusted sites > Sites 

Chrome uses its reliable site settings from IE settings, so after adding to IE it should also work in Chrome

+1
source share

Contact your Internet Information Server (IIS) manager to see if your application has user rights.

  • Go to the "Connections" panel on the left.
  • In the Sites section, navigate to your application or application folder
  • Right-click and select "Edit Permissions ..."
  • Go to the Security tab
  • Make sure your Windows ID or Windows group (if multiple users) have the correct permissions for this site in the "Groups or usernames" field.
  • If there is no user or group, click the "Edit" button, and then click the "Add" button

Also check if Windows Authentication is enabled , and both versions of Anonymous Authentication and ASP.NET Impersonation are disabled for the application in IIS. p>

0
source share

All Articles