How to disable WCF authentication

Discussion in 'ASP.NET WebServices' started by strato, Mar 26, 2009.

  1. I published a wcf service here at DASP. When I try to cosume it, I get this error:

    "the caller was not authenticated by the service"

    I'm using wsHttpBinding. I think, by default ws requires authentication. Has anyone succeeded in disabling authentication in ws binding?

    I was told that if I change to basicHttpBinding, and set security mode to "None" and also clientCredentialType to "None", then wcf will not require authentication. Has anyone succeeded in doing this?
     
  2. Anyone?
     
  3. Create a custom wsHttpBinding binding, set security mode to None, and set the endpoint bindingConfiguration to the custom binding.

    Here's a complete basic example:

    Code:
        <system.serviceModel>
            <serviceHostingEnvironment>
                <baseAddressPrefixFilters>
                  <add prefix="http://www.domain.com"/>
                </baseAddressPrefixFilters>
            </serviceHostingEnvironment>
            <services>
                <service name="Service" behaviorConfiguration="ServiceBehavior">
                    <!-- Service Endpoints -->
                    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="CustomBinding" contract="IService"></endpoint>
                    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
                </service>
            </services>
            <bindings>
                <wsHttpBinding>
                    <binding name="CustomBinding">
                        <security mode="None">
                            <message establishSecurityContext="false"/>
                            <transport clientCredentialType="None"/>
                        </security>
                    </binding>
                </wsHttpBinding>
            </bindings>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="ServiceBehavior">
                        <serviceMetadata httpGetEnabled="true"/>
                        <serviceDebug includeExceptionDetailInFaults="false"/>
                    </behavior>
                </serviceBehaviors>
            </behaviors>
        </system.serviceModel>
    
     
  4. Hi Aristotle,

    Your solution resolved my issue. Thanks
     

Share This Page