[英]Returning current user on a website with Windows Authentication in IIS 7.5
使用IIS 7.5,需要哪些IIS設置,web.config設置和C#代碼才能返回當前的Windows用戶?
Web.config值為
<authentication mode="Windows">
<identity impersonate="true" />
ApplicationConfig的值為
<windowsAuthentication enabled="true">
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
似乎並不能解決問題。
確保在Visual Studio項目的屬性中將Windows身份驗證設置為Enabled 。 在項目文件( .csproj )中,這表示為:
<IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
另外,將“ 托管管道模式”項目屬性設置為Classic :
<IISExpressUseClassicPipelineMode>true</IISExpressUseClassicPipelineMode>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.