Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 VS2012 IISExpress Windows Authentication

I'm trying to enable Windows Authentication to develop locally, as per the title:

  • Windows 8 (pro)
  • VS2012
  • IISExpress
  • ASP.Net MVC4 project
  • Orchard CMS is the project (but I don't think this is relevant)

Via the project properties, I've set Windows Authentication to enabled and Anonymous Authentication to disabled.

In the web.config I've set:

<authentication mode="Windows" />

However, when running the site I'm continually prompted for credentials. Entering Windows 8 or local account credentials don't seem to make any difference and I've set those accounts to have full permissions on the folder.

Any suggestions gratefully received!

UPDATE 1: As suggested by Darin Dimitrov I created a blank MVC project and selected the Intranet template. After setting Anonymous Authorisation to disabled and Windows Authentication enabled this test project worked exactly as expected (prompts for credentials when entered provides access to site). I applied the same authorisation config to my Orchard projects web.config:

<authentication mode="Windows" />
<authorization>
  <deny users="?" />
</authorization>

But still no joy, I'm prompted for credentials as expected but nothing I enter seems to authorise the user. I've Pastie'd the two web.configs below in case anyone else can point out what I'm missing?

  • Orchard Web.Config: http://pastie.org/private/8oe5jesvt0vmqgyn3w
  • Sample Web.Config: http://pastie.org/private/zgxyue03crzd6fb8umlidq
like image 451
DannyT Avatar asked Feb 19 '13 09:02

DannyT


People also ask

Does kestrel support Windows Authentication?

Windows Authentication (also known as Negotiate, Kerberos, or NTLM authentication) can be configured for ASP.NET Core apps hosted with IIS, Kestrel, or HTTP. sys.

Does IIS Express support Windows authentication?

Unlike IIS Server, IIS Express doesn't support Windows Authentication by default. You can enable the Windows Authentication in IIS Express by modifying the applicationhost. config under the “C:\Users[username]\Documents\IISExpress\config” directory.

How to use Windows Authentication in ASP net?

You need to disable the "Anonymous Authentication" and Enable the "Windows Authentication". and right click your application -> Manage Application -> Browse. Here you need to give your windows user name and password. (the credentials you're given when you log in to your machine).


1 Answers

Make sure you have enabled Windows Authentication in the properties of the Web Server and disabled Anonymous authentication:

enter image description here

Also make sure you have read the Text file that was generated for you when you created your new MVC application using the Intranet Template:

In order to use the Intranet template, you'll need to enable Windows authentication and disable Anonymous authentication.

IIS 7 & IIS 8

  1. Open IIS Manager and navigate to your website.
  2. In Features View, double-click Authentication.
  3. On the Authentication page, select Windows authentication. If Windows authentication is not an option, you'll need to make sure Windows authentication is installed on the server.

    To enable Windows authentication on Windows:

    a) In Control Panel open "Programs and Features".

    b) Select "Turn Windows features on or off".

    c) Navigate to Internet Information Services > World Wide Web Services > Security and make sure the Windows authentication node is checked.

    To enable Windows authentication on Windows Server:

    a) In Server Manager, select Web Server (IIS) and click Add Role Services

    b) Navigate to Web Server > Security and make sure the Windows authentication node is checked.

  4. In the Actions pane, click Enable to use Windows authentication.

  5. On the Authentication page, select Anonymous authentication.
  6. In the Actions pane, click Disable to disable anonymous authentication.

IIS Express

  1. Click on your project in the Solution Explorer to select the project.
  2. If the Properties pane is not open, open it (F4).
  3. In the Properties pane for your project:
    a) Set "Anonymous Authentication" to "Disabled".
    b) Set "Windows Authentication" to "Enabled".
like image 176
Darin Dimitrov Avatar answered Sep 22 '22 01:09

Darin Dimitrov