title: What is really a Principal in .NET?
body: <p>When talking about identity in .NET we have the idea of <a href="http://msdn.microsoft.com/en-us/library/System.Security.Principal" rel="noreferrer">Principal</a>. There's the interface <a href="http://msdn.microsoft.com/en-us/library/system.security.principal.iprincipal" rel="noreferrer"><code>IPrincipal</code></a> and together with it the implementation <a href="http://msdn.microsoft.com/en-us/library/system.security.claims.claimsprincipal" rel="noreferrer"><code>ClaimsPrincipal</code></a>. We can even access one instance of an implementation of that interface any time using <a href="http://msdn.microsoft.com/en-us/library/system.threading.thread.currentprincipal" rel="noreferrer"><code>Thread.CurrentPrincipal</code></a>.</p>
  
  <p>Now, I never understood what this principal really is. Indeed, at first I thought it was something representing the identity of the current user. But it's not, in fact there's another interface <a href="http://msdn.microsoft.com/en-us/library/system.security.principal.iidentity" rel="noreferrer"><code>IIdentity</code></a> together with implementation <a href="http://msdn.microsoft.com/en-us/library/system.security.claims.claimsidentity" rel="noreferrer"><code>ClaimsIdentity</code></a> for that. Searching a little I found the following on MSDN:</p>
  
  <blockquote>
    <p>A principal object represents the security context of the user on whose behalf the code is running, including that user's identity (IIdentity) and any roles to which they belong.</p>
  </blockquote>
  
  <p>But what this <em>security context of the user on whose behalf the code is running</em> really means? I think I didn't get yet what this is supposed to represent.</p>