相关疑难解决方法(0)

HTTP请求未经授权使用客户端身份验证方案'Ntlm'从服务器收到的身份验证头是'NTLM'

我知道有很多关于SO的问题与此类似,但我找不到这个问题.

有几点,第一点:

  • 无法控制我们的Sharepoint服务器.我无法调整任何IIS设置.
  • 我相信我们的IIS服务器版本是IIS 7.0.
  • 我们的Sharepoint Server正在通过NTLM预测请求.
  • 我们的Sharepoint服务器与我的客户端计算机位于同一个域中.
  • 我使用的是.NET Framework 3.5,Visual Studio 2008

我正在尝试编写一个简单的控制台应用程序来使用Sharepoint Web Services操作Sharepoint数据.我添加了服务参考,以下是我的app.config:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <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="Ntlm" proxyCredentialType="Ntlm" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://subdomain.companysite.com/subsite/_vti_bin/Lists.asmx"
            binding="basicHttpBinding" bindingConfiguration="ListsSoap"
            contract="ServiceReference1.ListsSoap" name="ListsSoap" />
    </client>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

static void Main(string[] args)
{
    using (var client = new ListsSoapClient())
    {
        client.ClientCredentials.Windows.ClientCredential = new …
Run Code Online (Sandbox Code Playgroud)

.net c# authentication sharepoint ntlm

49
推荐指数
3
解决办法
10万
查看次数

HTTP请求未经授权使用客户端身份验证方案"Negotiate".从服务器收到的身份验证标头是'NTLM'

几天前,当在客户端和wcf Web服务之间使用Windows身份验证时,我对身份验证问题感到非常头疼.我得到的错误是"HTTP请求未经授权,客户端身份验证方案'协商'.从服务器收到的身份验证头是"NTLM".堆栈上的解决方案都没有工作,因为大多数解决方案与旧方法有关.

c# windows authentication wcf

38
推荐指数
3
解决办法
10万
查看次数

标签 统计

authentication ×2

c# ×2

.net ×1

ntlm ×1

sharepoint ×1

wcf ×1

windows ×1