Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ultimately went with Yaron's suggestion and wrote a couple custom inspectors &amp; behaviors.</p> <p>Using proxy.ClientCredentials.UserName.UserName/Password was the cause of the original exception reported above. It would try and validate the return SOAP before processing subsequent added behaviors, resulting in response validation errors on the SAML assertion every time.</p> <p>The first behavior/inspector has two jobs: </p> <p>1) In the request side, manually add UsernameToken nodes; </p> <p>2) In the response side, extract the saml token; be sure to remove any offending "Security" XML nodes from the SOAP and reprocess the reply (prevents another error like the original post); save the SAML response for later.</p> <p>The second behavior/inspector injects the shared SAML assertion into the remainder of the requests.</p> <p>Here's the config required:</p> <pre><code> &lt;basicHttpBinding&gt; &lt;binding name="Default"&gt; &lt;security mode="Transport"&gt; &lt;transport clientCredentialType="None"/&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; </code></pre> <p>Here's some code (notice the removal of the ClientCredentials behavior):</p> <pre><code>var proxy = new LoginClient(); proxy.ChannelFactory.Endpoint.Behaviors.Remove&lt;ClientCredentials&gt;(); var initLogin = new InitialLoginMessageBehavior("username", "password"); proxy.Endpoint.Behaviors.Add(initLogin); var response = proxy.Login(); //use the SAML response var proxy2 = new OtherClient(); proxy2.ChannelFactory.Endpoint.Behaviors.Remove&lt;ClientCredentials&gt;(); proxy2.Endpoint.Behaviors.Add(new SamlAuthenticationMessageBehavior(initLogin.Saml)); var response2 = proxy2.DoSomethingElse(); </code></pre> <p>Everything you need for creating behaviors and inspectors:</p> <p><a href="http://msdn.microsoft.com/en-us/library/aa717047(v=vs.100).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa717047(v=vs.100).aspx</a></p> <p><a href="http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx" rel="nofollow">http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload