title: How to identify a user with auth0 jwt
body: <p>I have an angular2 frontend which is using Auth0 for authentication and a .net core app on the backend. All is working with enforcing secured API calls.</p>
  
  <p><strong>What is the best way to identify an authenticated user on the backend?</strong> A rather clumsy way I can think of doing this is to expose a 'setUserToken' api call which allows me to connect a user ID to either of the following:</p>
  
  <ul>
  <li><p>token <code>var bearerToken = Request.Headers["Authorization"].ToString()</code></p></li>
  <li><p>social ID <code>var socialId = User.Claims.Where(c =&gt; c.Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier").First().Value</code></p></li>
  </ul>
  
  <p>That way, with subsequent API calls, I can simply <code>findUserByToken()</code> or <code>findUserBySocialProviderOpenId()</code></p>
  
  <p>I'm sure I'm missing a much more obvious solution to this problem. Any guidance would be greatly appreciated.</p>