title: .net Web API. How to retrieve user properties (user Id) from access token? Request handler code based on current user/token
body: <p>Let's say you have a .net Web API server for a user based application. The user logs into the application with a username and password which is sent to the server and the app is given an access token back.</p>
  
  <p>Now the app wants to show pieces of user information (stored on the server in a DB). So it makes the http request to server and includes the access token in the header. </p>
  
  <p>How do you restrict that the server will only send back to the application the relevent information for that particular user and no one else's information.</p>
  
  <p>Is there a way, when I receive their username and password and am creating a token to send back, to associate their userId with that token? So now when I get a request to something like /GetUserFoodPreferences, I can just get the userId from the token and query my db based on that id.</p>
  
  <p>Is this the correct approach?</p>