We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
我也在努力解决同样的问题,经过一番研究后发现这篇博客文章让我滚动:
http://pfelix.wordpress.com/2011/04/21/wcf-web-api-self-hosting-https-and-http -basic-authentication/
简而言之,您需要做一些工作才能允许主体流向服务调用。
I was struggling with this same thing, and after some research found this blog post that got me rolling:
http://pfelix.wordpress.com/2011/04/21/wcf-web-api-self-hosting-https-and-http-basic-authentication/
In short, there is some work you need to do to allow the Principal to flow through to the service call.
上有一个完整的可下载示例,
MSDN WCF 数据服务
其中包含 PowerPivot 客户端的基本身份验证https://code.msdn.microsoft.com/office/WCF-Data-Service-with-547e9341
更新
好的,现在我已经使用了链接中的代码(我当时正在研究我发布了)我知道它可以工作,所以这里是代码示例:
步骤 1:编写一个 HTTP 处理程序来处理所有请求并执行身份验证(或发出 401 质询)。
步骤 2:通过 web.config 使用 IIS 配置新处理程序。
对于 Excel PowerPivot 很重要
请参阅此错误:PowerPivot 未将基本身份验证中的授权标头发送到 OData Svc
There's a full downloadable sample on MSDN
WCF Data Service with basic authentication for PowerPivot clients
https://code.msdn.microsoft.com/office/WCF-Data-Service-with-547e9341
Update
Okay, now I've used the code in the link (that I was researching at the time I posted) I know that it works, so here's the code example:
Step 1: Write an HTTP handler to handle all requests and perform the authentication (or issuance of a 401 challenge).
Step 2: Configure your new handler with IIS via your web.config.
Important for Excel PowerPivot
See this bug: PowerPivot not sending Authorization header in Basic Authentication to OData Svc