Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The username is not provided. Specify username in ClientCredentials

I Create a WCF application with client credential. It's working fine internally while i refer and call this service from the other project means i got the error message.

The username is not provided. Specify username in ClientCredentials.

Please help me to solve this.

<bindings>
  <wsHttpBinding>
 <binding name="WSHttpBinding_IWcfService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                allowCookies="false">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:10:00"
                    enabled="false" />
                <security mode="TransportWithMessageCredential">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="UserName" negotiateServiceCredential="true"
                        algorithmSuite="Default" />
                </security>
            </binding>
  </wsHttpBinding>
</bindings>
<client>
 <endpoint address="https://wcfauthtest.sbs.in:448/WcfService.svc/WcfService.svc"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWcfService"
                contract="AuthTest.IWcfService" name="WSHttpBinding_IWcfService">
                <identity>
                    <dns value="localhost" />
                </identity>
 </endpoint>
</client>

Any help?

like image 989
user3085540 Avatar asked Feb 24 '14 09:02

user3085540


1 Answers

Have you specified the credentials on the client/consumer end of things:

WcfService.UserName.UserName = "user";
WcfService.UserName.Password = "pass";

You should provide these credentials before making any call to the WCF service in your code.

like image 137
Seany84 Avatar answered Oct 22 '22 07:10

Seany84