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

强颜欢笑 提交于 2020-01-14 09:33:49

问题


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


回答1:


The web config should overwrite the IIS express config but in this case it seems it does not. What you can try to do is to turn it off on the IIS level as well.

You can go to this directory \IISExpress\config\applicationhost.config open up this file and set the <windowsAuthentication enabled="false" />.




回答2:


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.



来源:https://stackoverflow.com/questions/26910724/turn-off-disable-windows-authentication-for-asp-net-mvc

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