title: Using Claims Types properly in Owin Identity and Asp.Net MVC
body: <p>I am using Owin and Identity and I am having a problem with Claims.</p>
  
  <p>I have applications where users use an email to authenticate and others that use an username.</p>
  
  <ol>
  <li><p>The sign in method in the business layer can accept an Email or an Username depending on the case.</p></li>
  <li><p>To "obfuscate" the user identity I use a GUID, unique to each user, when displaying a page with user info.</p>
  
  <p>I also use this because sometimes an email or an username can be a problem in the url ...</p></li>
  </ol>
  
  <p>When I sign a user I have the following claims types:</p>
  
  <pre><code>new Claim(ClaimTypes.Email, user.Email),
  new Claim(ClaimTypes.Name, user.FullName),
  new Claim(ClaimTypes.GivenName, user.FirstName),
  new Claim(ClaimTypes.Surname, user.LastName),
  new Claim(ClaimTypes.NameIdentifier, user.UserUniqueIdentifier.ToString())
  </code></pre>
  
  <p>So my interpretation is:</p>
  
  <pre><code>Email is the user's email
  
  Name is the user's full name
  
  GivenName is the user's first name
  
  Surname is the user's last name
  
  NameIdentifier is the user's unique identifier ... It can be the email, the username or in this case I am using an Unique ID.
  </code></pre>
  
  <p>What is strange is there is no Claim Type for Username. Where would to place it?</p>
  
  <p>Basically it seems there is a problem when a Username is not used as the Unique name identifier but it is still necessary.</p>
  
  <p>Is something wrong with my logic claims types?</p>