The caller was not authenticated by the service

Discussion in 'Site Programming, Development and Design' started by wsyeager36, Feb 2, 2012.

  1. I am using a WCF 4 web service with a wshttpbinding and am getting the below error when trying to retrieve records via my hosting service.

    Note that I am able to run my service locally fine and when invoking it via the WCF Client test tool, I get valid results back.

    I've looked up this msg and there appears to be lots of activity on it (which partially, I have tried, but not worked) but nothing specific to suit my needs to simply just get the service to invoke methods properly.

    I would appreciate it very much if someone could provide the exact syntax I would need updated in my following config files in order for this to get to work. I personally don't care what kind of security is used. It would be fine if "None" was used.

    Thanks so much in advance.

    The caller was not authenticated by the service.

    Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at IYeagerTechWcfService.GetCategories()
    at YeagerTechWcfServiceClient.GetCategories()

    Inner Exception:
    The request for security token could not be satisfied because authentication failed.
    at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)
    at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)

    Service System.ServiceModel node
    <system.serviceModel>
    <services>
    <service name="YeagerTechWcfService.YeagerTechWcfService">
    <endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
    <baseAddresses>
    <add baseAddress="http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" />
    </baseAddresses>
    </host>
    </service>
    </services>
    <bindings>
    <wsHttpBinding>
    <binding name="WSHttpBinding_IYeagerTechWcfService" closeTimeout="00:02:00" openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
    </binding>
    </wsHttpBinding>
    </bindings>
    <diagnostics wmiProviderEnabled="true">
    <messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="500" />
    </diagnostics>
    <behaviors>
    <serviceBehaviors>
    <behavior>
    <!--To avoid disclosing metadata information,
    set the value below to false and remove the metadata endpoint above before deployment-->
    <serviceMetadata httpGetEnabled="True"/>
    <!--To receive exception details in faults for debugging purposes,
    set the value below to true. Set to false before deployment
    to avoid disclosing exception information-->
    <serviceDebug includeExceptionDetailInFaults="True" />
    <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    </system.serviceModel>
    Client Service config


    <services>
    <clear />

    <service name="YeagerTechWcfService.YeagerTechWcfService">
    <endpoint address="" binding="wsHttpBinding" contract="YeagerTechWcfService.IYeagerTechWcfService">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
    <baseAddresses>
    <add baseAddress="http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" />
    </baseAddresses>
    </host>
    </service>
    </services>

    Client endpoint config

    <client>
    <endpoint address="http://yeagerte.w07.Winhost.com/yeagerte/YeagerTechWcfService.YeagerTechWcfService.svc/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IYeagerTechWcfService" contract="YeagerTechWcfService.IYeagerTechWcfService" name="WSHttpBinding_IYeagerTechWcfService">
    <identity>
    <dns value="localhost" />
    </identity>
    </endpoint>
    </client>
     
    Last edited by a moderator: Oct 14, 2015
  2. Client web.config:

    <system.serviceModel>
    <bindings>
    <basicHttpBinding>
    <binding name="basicHttpBinding_IYeagerTechWcfService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="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="None">
    <!--<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
    <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />-->
    </security>
    </binding>
    </basicHttpBinding>
    </bindings>
    <diagnostics wmiProviderEnabled="true">
    <messageLogging logMessagesAtTransportLevel="true" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="2147483647" maxMessagesToLog="500" />
    </diagnostics>
    <behaviors>
    <serviceBehaviors>
    <behavior>
    <!-- To avoid disclosing metadata information,
    set the value below to false and remove the metadata endpoint above before deployment -->
    <serviceMetadata httpGetEnabled="True" />
    <!-- To receive exception details in faults for debugging purposes,
    set the value below to true. Set to false before deployment
    to avoid disclosing exception information -->
    <serviceDebug includeExceptionDetailInFaults="True" />
    <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>
    </serviceBehaviors>
    </behaviors>

    <services configSource="Configs\Prod\system.serviceModel.services.config" />

    <client configSource="Configs\Prod\system.serviceModel.client.config" />

    </system.serviceModel>
     
  3. found solution... closed...
     
  4. What was the solution?
     
  5. Yes, please... What WAS YOUR SOLUTION???

    If you don't mind, please enlighten the rest of us. :)
     
  6. I needed to add the following to the client web.config file:

    Inside the system.web node:
    <trust level="Full"></trust>
    <system.serviceModel>
    <bindings>
    <wsHttpBinding>
    <security mode="Message">
    <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
    <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
    </security>
     
  7. I added the code (<trust level="Full"></trust> above <system.serviceModel>) but it gives following error:


    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Unrecognized configuration section trust.


    Line 154: </runtime>
    Line 155:
    Line 156: <trust level="Full"></trust>
    Line 157:
    Line 158: <system.serviceModel>
     
  8. rum

    rum Winhost Staff

    Last edited by a moderator: Oct 14, 2015

Share This Page