title: JWT and Web API (JwtAuthForWebAPI?) - Looking For An Example
body: <p>I've got a Web API project fronted by Angular, and I want to secure it using a JWT token.  I've already got user/pass validation happening, so I think i just need to implement the JWT part.</p>
  
  <p>I believe I've settled on JwtAuthForWebAPI so an example using that would be great.</p>
  
  <p>I assume any method not decorated with [Authorize] will behave as it always does, and that any method decorated with [Authorize] will 401 if the token passed by the client doesn't match.</p>
  
  <p>What I can't yet figure out it how to send the token back to the client upon initial authentication.</p>
  
  <p>I'm trying to just use a magic string to begin, so I have this code:</p>
  
  <pre><code>RegisterRoutes(GlobalConfiguration.Configuration.Routes);
  var builder = new SecurityTokenBuilder();
  var jwtHandler = new JwtAuthenticationMessageHandler
  {
      AllowedAudience = "http://xxxx.com",
      Issuer = "corp",
      SigningToken = builder.CreateFromKey(Convert.ToBase64String(new byte[]{4,2,2,6}))
  };
  
  GlobalConfiguration.Configuration.MessageHandlers.Add(jwtHandler);
  </code></pre>
  
  <p>But I'm not sure how that gets back to the client initially.  I think I understand how to handle this on the client, but bonus points if you can also show the Angular side of this interaction.</p>