Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since you are already using a MembershipProvider you can utalize that on wcf as well so both are secured by the same mechanism.</p> <p>See this <a href="http://msdn.microsoft.com/en-us/library/ms731049.aspx" rel="nofollow">post</a> on msdn.</p> <blockquote> <p>Windows Communication Foundation (WCF) developers can take advantage of these features for security purposes. When integrated into an WCF application, users must supply a user name/password combination to the WCF client application. To transfer the data to the WCF service, use a binding that supports user name/password credentials, such as the WSHttpBinding (in configuration, the wsHttpBinding Element) and set the client credential type to UserName. On the service, WCF security authenticates the user based on the user name and password, and also assigns the role specified by the ASP.NET role.</p> </blockquote> <p>Another option would be to create a custom <code>IAuthorizationPolicy</code> that pulls off your user via</p> <pre><code>OperationContext.Current.IncomingMessageHeaders.GetHeader&lt;T&gt; </code></pre> <p>And than setup your principal like the following:</p> <pre><code>evaluationContext.Properties[Constants.EvaluationContextPrincipal] = principal; </code></pre> <p>Here is some more information on creating a custom <a href="http://msdn.microsoft.com/en-us/library/ms751416.aspx" rel="nofollow">IAuthroizationPolicy</a>. With this method you could achieve what you want without passing your user to the method. </p> <p><em>Just be warned</em> if you go this route a crafty person could end up impersonating the user by simply suppling a bogus user in your header. </p> <p>Using the asp.net membership provider for wcf would most likely get you what you are really after plus adding some security.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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