0

I want to be able to specify a security level for my custom binding the same way you do with an basicHttpBinding.

  <customBinding>
    <binding name="jsonpBinding" >      
      ....                
      <security mode="TransportCredentialOnly">
          <transport clientCredentialType="Windows"/>
      </security>
    </binding>
  </customBinding>

How does one do this correctly as its not accepted?

Jonathan
  • 2,318
  • 7
  • 25
  • 44
  • 2
    Did you even try googling "wcf kerberos"? Does this answer your question? First result: http://stackoverflow.com/questions/1295526/wcf-and-kerberos-authentication –  Jun 13 '11 at 17:31
  • @Inuyasha This is specific to CustomBinding it works fine with basicHttpBinding. – Jonathan Jun 13 '11 at 17:33

1 Answers1

1

Adding authenticationScheme="Negotiate" resolved the issue.

Add this to your WCF method

[OperationBehavior(Impersonation = ImpersonationOption.Required)]
public int Dosomething()
{
...
}

Add this to your WCF web.config

 <customBinding>     
    <binding name="jsonpBinding" >             
       <jsonMessageEncoding/>
       <httpTransport manualAddressing="true" authenticationScheme="Negotiate"/>
    </binding>
 </customBinding>

Adding the following to your client (MVC Web App in my case). Its worth noting that the svcutil application does not generate the behavior for your client stub and you have to add it manualy. This had me for some time!

<client>
          <endpoint address="..."
              binding="customBinding" bindingConfiguration="..."
              contract="..." name="..."  behaviorConfiguration="ImpersonationBehavior" />        
        </client>
        <behaviors>
          <endpointBehaviors>
            <behavior name="ImpersonationBehavior">
              <clientCredentials>
                <windows allowedImpersonationLevel="Impersonation"/>
              </clientCredentials>
            </behavior>            
          </endpointBehaviors>          
        </behaviors>
Jonathan
  • 2,318
  • 7
  • 25
  • 44