Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF - Configuring Client/server authentication in headers?
    primarykey
    data
    text
    <p>I've got a WCF service that will need to receive client credentials, and maintain some kind of role-based data, based on my auth method.</p> <p>The clients will reside on many different systems, and as such, each client will have a unique userID and pw.</p> <p>I'm using basicHttpBinding and have read a few articles, such as this one, <a href="http://nirajrules.wordpress.com/2009/05/22/username-over-https-custombinding-with-wcf%E2%80%99s-channelfactory-interface/" rel="nofollow noreferrer">http://nirajrules.wordpress.com/2009/05/22/username-over-https-custombinding-with-wcf%E2%80%99s-channelfactory-interface/</a>, that describe the process. </p> <p>So what I'm looking for is if someone has a full client/server configured like this to take a look at so I can derive my own solution from this.</p> <p>What I'd like to do is have the username and password passed in the headers for each request, passing back some kind of SecurityTokenValidationException on fail, or continuing if passing.</p> <p>Thanks.</p> <p><strong>UPDATE</strong></p> <p>I'm using the wsHttpbinding with the following config on both the client and server:</p> <pre><code> &lt;wsHttpBinding&gt; &lt;binding name="wsHttpEndpointBinding" &gt; &lt;security mode="TransportWithMessageCredential"&gt; &lt;transport clientCredentialType="Basic" /&gt; &lt;message clientCredentialType="UserName" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/wsHttpBinding&gt; </code></pre> <p>And the call out to the server from the client as follows:</p> <pre><code>ServiceReference1.ServiceClient myClient = new ServiceReference1.ServiceClient(); myClient.ClientCredentials.UserName.UserName = "billuser"; myClient.ClientCredentials.UserName.Password = "mypassword"; Response.Write("Data from WCF Service: " + myClient.GetData(1)); </code></pre> <p>I think I need a bit of a hand with linking up the CustomUsernamePasswordValidator on the server as I'm still getting the '...could not be activated.' error.</p>
    singulars
    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.
 

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