title: WCF4 REST APIkey question - pass information from ServiceAuthorizationManager to services
body: <p>I want to implement an API key authentication solution for my WCF4 REST API.</p>
  
  <p>I know that I need to make a class and derive it from ServiceAuthorizationManager and override the CheckAccessCore method. All that I understand.</p>
  
  <p>But what I want to do from the CheckAccessCore pass internal information from the CheckAccessCore to my Service implementation classes. Information like "ApiKeyID, rights, flags and other details" that I looked up when doing the ApiKey authentication. </p>
  
  <p>So that my services internally can use the internal ApiKeyID when it calls the domain logic.</p>
  
  <p>I have seen many different ways of doing this, like</p>
  
  <pre><code>operationContext.ServiceSecurityContext.AuthorizationContext.Properties["Principal"] = p;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>System.Threading.Thread.CurrentPrincipal = principal;
  HttpContext.Current.User = principal;
  </code></pre>
  
  <p>and other ways....</p>