Configure Webmatrix for Windows Users

左心房为你撑大大i 提交于 2019-12-05 05:22:27

问题


I create asp .net page and i have use windows user to authenticate.


<authentication mode="Windows" />

I create simply page with one label and display information.


if (Page.User.Identity.IsAuthenticated)
{
        Label1.Text = "Authenticated = 'TRUE'<br/>";
        Label1.Text = Page.User.Identity.Name;
}
else
{
        Label1.Text = "Authenticated = 'FALSE'<br/>";
}

I often get Authenticated = 'FALSE'

How configure web.config and WebMatrix to take user from Windows?


回答1:


Probably you published your web site without changing authentication on the corresponding virtual directory of IIS.

You should deactivate "Anonymous" authentication and activate "Windows" authentication. The existence of <authentication mode="Windows" /> line in web.config is not enough for IIS. Moreover "Windows" authentication must be installed of cause (see for example this for more information).




回答2:


try

<appSettings>
  <add key="enableSimpleMembership" value="false" />
</appSettings> 


来源:https://stackoverflow.com/questions/3466710/configure-webmatrix-for-windows-users

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