dotnet / dotnet/wcf

The HTTP request was forbidden with client authentication scheme 'Basic'

Open
#4,493 1 comment 0 reactions 1 assignee Claimed by @mconnew View on GitHub
WSFederation
Dominant language
C#
Stars
1.8k
Forks
576
Avg merge
6d 9h
Merged PRs (30d)
2

Description

```c#
var address = new EndpointAddress(@"url");
var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
var client = new ZSALFM036PortTypeClient(binding, address);
client.ChannelFactory.Credentials.UserName.UserName = "username";
client.ChannelFactory.Credentials.UserName.Password = "password";
var list = new List { };
list.Add(new ZSSAL032() { SERNR = "CQ1-98002868" });
string result = string.Empty;
var data = client.ZSALFM036(list.ToArray(), "E", out result);
```
this code was working at “System.ServiceModel 4.4.0”
but it will throw error "The HTTP request was forbidden with client authentication scheme 'Basic'" at “System.ServiceModel 4.8.0”

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.