且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HTTP 请求未经授权,客户端身份验证方案为“基本".从服务器接收的身份验证标头是“基本领域=“pc""

更新时间:2023-09-12 18:02:52

我创建了一个这样的客户端:

I had created a client like this:

using (var client = new Client())
    {

    client.ClientCredentials.UserName.UserName = <username>;
    client.ClientCredentials.UserName.Password = **<WRONG_PASSWORD>**;
...
    }

我的绑定的安全部分如下所示:

The security section of my binding looked like this:

          <security mode="Transport">
            <transport clientCredentialType="Basic" proxyCredentialType="Basic" realm="" />
          </security>

我看到这个错误又回来了.更正密码后,一切正常.

And I saw this error come back. Once I corrected the password, everything worked.