Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off / Disable windows authentication for asp.net-mvc

I created a new asp.net-mvc project and during setup I chose to use Windows Authentication.

Now I like to turn it off(at least for a while).

I changed the web.config to this

 <authentication mode="None" />

But that does change anything. It will still prompt me. I am using the IIS Express.

UPDATE: I mean it still prompts me when using Firefox. Internet Explorer will continue and not show my domain username

like image 921
Jepzen Avatar asked Nov 13 '14 14:11

Jepzen


People also ask

How do I turn off Windows authentication in web config?

In the IIS Manager: Expand the computer name, then Sites, then Default Web Site, then click on the name of the desired site. Select Authentication. Set Windows Authentication to Disabled and set Basic Authentication to Enabled.

What is Windows authentication in ASP.NET MVC?

When you enable Windows authentication, your web server becomes responsible for authenticating users. Typically, there are two different types of web servers that you use when creating and deploying an ASP.NET MVC application.


1 Answers

1.) Close VS

2.) Remove the .vs/config or the .vs folder next to your solution. The IIS Express regenerates the config/applicationhost.config file. Changing this file does NOT help - it is regenerated

3.) Edit the <project>.csproj.user file. There change the lines

<IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>

to

<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
<IISExpressWindowsAuthentication>disabled</IISExpressWindowsAuthentication>

4.) Edit and change the web.config Change

<authentication mode="Windows" />

to

<authentication mode="None" />

or comment the whole authentication XML element.

like image 100
Hansjörg Reister Avatar answered Sep 19 '22 16:09

Hansjörg Reister