[英]Getting IIS unauthorized html page instead of web api unauthorized response for unauthorized status
[英]Web API Getting 401 Unauthorized in IIS but works in IIS Express
我有一個Web API項目,可以進行遠程SOAP調用。 在IIS Express(win 7)中可以正常工作,但在IIS 7.5(win 7)或IIS 8.5(wind server 2012 R2)中均不能使用。
這是IIS Express中的響應
{
Content-Length: 429
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Date: Wed, 16 Mar 2016 23:00:52 GMT
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
}
這是IIS 7.5中的響應
{Content-Type: text/html
Server: Microsoft-IIS/7.0
WWW-Authenticate: Negotiate,NTLM
X-Powered-By: ASP.NET
Date: Wed, 16 Mar 2016 22:13:10 GMT
Content-Length: 1293
}
我已禁用 Windows身份驗證,並且僅在IIS 7.5中啟用了匿名身份驗證
實際上,我還完成了applicationHost.config的WinDiff,並復制了從IIS Express到IIS 7不同(且適用)的設置。
Web.Config具有<Authentication mode ="None">
我不確定要執行此操作需要做什么。
已編輯解決
IIS的響應清楚地表明已啟用Windows身份驗證。 請仔細檢查IIS配置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.