C#C
C#3y ago
Skit

✅ WCF Basic Auth works with Windows but not Android Client

These binding settings work with my .net maui windows client
but on android i get this response

" The HTTP request is unauthorized with client authentication scheme 'Basic'. The authentication header received from the server was 'Basic realm=""'."

                BasicHttpBinding binding = new BasicHttpBinding
                {
                    Security = new BasicHttpSecurity
                    {
                        Mode = BasicHttpSecurityMode.Transport,
                        Message = new BasicHttpMessageSecurity()
                        {
                            ClientCredentialType = BasicHttpMessageCredentialType.UserName,
                        },
                        Transport = new HttpTransportSecurity
                        {
                            ClientCredentialType = HttpClientCredentialType.Basic,
                            ProxyCredentialType = HttpProxyCredentialType.Basic
                        }
                    },
                    AllowCookies = true,
                    MaxReceivedMessageSize = int.MaxValue,
                    ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max,
                    MaxBufferSize = int.MaxValue,
                };


I have tried many combinations but nothing seems to work. And on google i don't find anything android related.
Anyone got an idea what could be the reason?
Was this page helpful?