The link to use to communicate with the Federation Service at the URL is not specified


I'm currently using ADFS as a security token service. I want to federate the WCF service with ADFS. I created WCF service and added the STS reference of ADFS by using Federation utility.

Inorder to use the federated wcf service, I created WPF application and added service reference. I called the service api using following code.

var client = new SecureWpfApplication.ServiceReference1.Service1Client();

Uri uri = new Uri("");
ICredentials credentials = CredentialCache.DefaultCredentials;
NetworkCredential credential = credentials.GetCredential(uri, "Basic");

client.ClientCredentials.Windows.ClientCredential = credential;

client.ClientCredentials.SupportInteractive = false;


I got the error "The binding to use to communicate to the federation service at 'https://{ADFS server}/adfs/services/trust/13/usernamemixed' is not specified.

How to resolve this?

I created the wcf service configuration like

  <service name="SecureWcfService.Service1" behaviorConfiguration="SecureWcfService.ServiceBehaviour">
    <endpoint address="https://wcfserver/SampleWcfService/Service1.svc" binding="ws2007FederationHttpBinding" contract="SecureWcfService.IService1" bindingConfiguration="SecureWcfService.IService1_ws2007FederationHttpBinding" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <behavior name="SecureWcfService.ServiceBehaviour">
      <federatedServiceHostConfiguration name="SecureWcfService.Service" />
      <serviceMetadata httpGetEnabled="true" />
        <serviceCertificate findValue="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
        <add name="federatedServiceHostConfiguration" type="Microsoft.IdentityModel.Configuration.ConfigureServiceHostBehaviorExtensionElement, Microsoft.IdentityModel, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <binding name="SecureWcfService.IService1_ws2007FederationHttpBinding">
        <security mode="Message">
                <issuerMetadata address="https://adfsserver/adfs/services/trust/mex" />
                    <add claimType="" isOptional="true" />
                    <add claimType="" isOptional="true" />
            <add value="https://wcfserver/SecureWcfService/Service1.svc" />
        <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                <add thumbprint="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" name="http://asfsserver/adfs/services/trust" />
                <add thumbprint="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" name="http://adfsserver/adfs/services/trust" />
        <certificateValidation certificateValidationMode="None" />

I got the error "The binding to use to communicate to the federation service at '' is not specified.

It seems to me as if you need to follow some more tutorials and/or read some more web pages before you continue with your WCF Service. How to use WCF is far too broad a topic for this website, but in basic, you need to define a binding element in your config files that specifies that you want to use the Federation Service in your WCF Service.

Have a good, long read of the How to: Create a WSFederationHttpBinding page on MSDN. From the linked page:

Create a element in the bindings section that can be used to communicate with the security token service. For more information about creating a binding, see How to: Specify a Service Binding in Configuration.

You could also read the (WCF) Getting Started Tutorial page on MSDN for some further background reading.