HTTP 请求未经客户端身份验证方案“协商”的授权。身份验证标头

发布于 2024-12-08 21:48:13 字数 1447 浏览 0 评论 0原文

我正在尝试从我们的办公室共享点调用网络服务。当我从我们的测试项目中调用它时它可以工作,并且我可以访问 url 并通过浏览器检索信息,但是当我通过 Web 服务调用它时,我收到以下错误:

System.ServiceModel.Security.MessageSecurityException:HTTP 请求未经授权客户端身份验证方案“协商”。从服务器收到的身份验证标头是“基本领域=”

当我们登录到 sharepoint 时,我们使用 Windows 凭据自动登录。

我的网络配置如下所示:

<binding name="ListsSoap" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00"
    sendtimeout="00:01:00" allowcookies="false" bypassproxyonlocal="false" hostnamecomparisonmode="StrongWildcard"
    maxbuffersize="65536" maxbufferpoolsize="524288" maxreceivedmessagesize="65536"
    messageencoding="Text" textencoding="utf-8" transfermode="Buffered" usedefaultwebproxy="true">

  <readerQuotas maxDepth="32" maxStringContentLength="8192"
     maxArrayLength="16384"
                       maxBytesPerRead="4096"
    maxNameTableCharCount="16384" />
  <security mode="Transport">
    <transport clientCredentialType="Windows" proxyCredentialType="Basic" realm="" />
    <message
    clientCredentialType="UserName" algorithmSuite="Default" />
  </security>
</binding>

url 使用 SSL(即 https://blahblah. com.sharepoint.emea.microsoftonline.com/Lists/....)

我几乎使用了所有组合:带有 ntlm 的传输、带有基本的 TransportWithMessageCredential 等,我要么收到错误消息,它期待 http,但得到的是 https。

感谢您的帮助

E

I'm trying to call a webservice from our office sharepoint. It works when I call it from our testing project and I can access the url and retrieve information through the browser but when I call it through a webservice I get the following error:

System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Basic realm=

When we log into sharepoint we use our windows credentials to login automatically.

My web config looks like this within :

<binding name="ListsSoap" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00"
    sendtimeout="00:01:00" allowcookies="false" bypassproxyonlocal="false" hostnamecomparisonmode="StrongWildcard"
    maxbuffersize="65536" maxbufferpoolsize="524288" maxreceivedmessagesize="65536"
    messageencoding="Text" textencoding="utf-8" transfermode="Buffered" usedefaultwebproxy="true">

  <readerQuotas maxDepth="32" maxStringContentLength="8192"
     maxArrayLength="16384"
                       maxBytesPerRead="4096"
    maxNameTableCharCount="16384" />
  <security mode="Transport">
    <transport clientCredentialType="Windows" proxyCredentialType="Basic" realm="" />
    <message
    clientCredentialType="UserName" algorithmSuite="Default" />
  </security>
</binding>

The url uses SSL (i.e. https://blahblah.com.sharepoint.emea.microsoftonline.com/Lists/....)

I've used almost every combination there is: transport with ntlm, TransportWithMessageCredential with basic etc and I either get the error message that it's expecting http and it get's https.

Thanks for the help

E

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二智少女猫性小仙女 2024-12-15 21:48:13

您的客户端和服务器使用不同的身份验证方案。服务器使用“基本身份验证”,而客户端使用“协商”,我猜这是 Windows 身份验证。

Your client and server is using different authentication scheme. The server uses 'Basic Authentication' while your client uses 'Negotiate' which I guess is Windows Authentication.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文