title: Where is the best place to have custom Principal/Identity set?
body: <p>I have been working on a web site (using ASP.NET C#) that uses both forms based and claims based authentication.  I wanted to override the ClaimsIdentity class so I could implement a custom IsAuthenticated method and add more properties for the identity specific for the claims authentication.</p>
  
  <p>I'm implementing a custom WSFederationAuthentionModule currently, but I was trying to figure out what module I should override (specifically what method) so I can set my custom identity/principal rather than the default ClaimsPrincipal?  </p>
  
  <p>So far I have looked at both the SessionAuthenticationModule and ClaimsPrincipalHTTPModule, but I could not figure out at what step the principal is set/the best way to override it.</p>
  
  <p>Thanks</p>
  
  <p><strong>Addition:</strong>
  Since I'm kind of new at this let me be sure this is correct: The way to set an identity is to set a custom principal which is set to use that identity:</p>
  
  <pre><code>System.Threading.Thread.CurrentPrincipal = customClaimsPrincipal;
  </code></pre>
  
  <p>Alternatively if a custom principal was not needed then the ClaimPrincipal class could be constructed with a ClaimsIdentityCollection. </p>