401 未经 OData 更新和删除授权
我第一次偶然发现一个问题,其中尚未(完全)提供解决方案,但我希望有人可以提供帮助。
我的问题类似于 RESTful 中的 PUT 和 DELETE WCF 服务导致 401 未经授权的错误。
也就是说,我有一个 WCF 数据服务,每当我尝试更新或删除(读取和发布作品没有任何问题)时,我都会收到 401。与上述帖子的不同之处在于,我不是在 IIS 中托管我的服务,而是在 Windows Azure 上托管我的服务,因此我无法应用该解决方案。
我在使用 OData 扩展的 .NET 客户端和 Restlet 客户端上都遇到了同样的问题(401:尝试更新或删除时凭据无效
)。但是,在 .NET 客户端上,我可以通过设置 UsePostTunneling = true 来解决该问题。
在我的服务中,我设置了 config.SetEntitySetAccessRule("*", EntitySetRights.All)
。
有谁知道我该如何解决我的 Restlet 客户端的问题?
For the first time I have stumbled upon a problem where the solution has not already been provided (completely) on SO, but I hope someone out there can help.
My problem is similar to PUT and DELETE in RESTful WCF Service cause 401 Unauthorized error .
That is, I have a WCF Data Service where I get a 401 whenever I try to do updates or deletes (read and post works without any problems). The difference to the abovementioned post is that I am not hosting my service in IIS but on Windows Azure, so I am not able to apply that solution.
I have the same problem (401: invalid credentials when attempting updates or deletes
) on both a .NET client and a restlet client using the OData extension. However, on the .NET client I am able to resolve the issue by setting UsePostTunneling = true.
In my service I have set config.SetEntitySetAccessRule("*", EntitySetRights.All)
.
Does anyone know how I can resolve the issue for my restlet client?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我要检查的第一件事是查看您的处理程序中是否启用了 PUT 和 DELETE 动词。您是从完整 IIS 中的 Web 角色运行此程序,还是使用托管 Web 核心 (HWC),还是其他东西?通常,除了 401 之外,我还会看到 405 错误,因为机器上有 WebDAV,并且 PUT 和 DELETE 动词在那里发生冲突。您最终必须禁用该应用程序的 WebDAV。
我还会在您的 web.config 中检查您的身份验证方法。我发现“无”类型会导致问题,因此将其更改为“表单”。
First thing I would check is to see if you have PUT and DELETE verbs enabled in your handlers. Are you running this from a web role in full IIS or are you using Hosted Web Core (HWC), or something else? Usually, more than a 401, I see a 405 error because WebDAV is on the machine and PUT and DELETE verbs conflict there. You end up having to disable WebDAV for the app.
I would also check your authentication method in your web.config. I have seen the 'none' type cause issues, so change that to Forms.