title: Modifying OWIN OAuth middleware to use JWT bearer tokens
body: <p>I'm currently trying to create a proof of concept for claims based authentication for a new app using a combination of the following technologies: Web API 2, OWIN middleware and JWT. </p>
  
  <p>To keep things simple I started with the Web API 2 project template and changed the authentication to 'Individual User Accounts'. The sample client I created was then able to get a token by calling /Token and was able to call a sample endpoint with the OAuth bearer token. So far so good. I then added the following code to Startup.Auth.cs to try and enable JwtBearerAuthentication:</p>
  
  <pre><code>    var jwtOptions = new JwtBearerAuthenticationOptions
      {
          AllowedAudiences = audiences,
          IssuerSecurityTokenProviders = new[] { 
              new SymmetricKeyIssuerSecurityTokenProvider(issuer, signingKey) }
      };
  
      app.UseJwtBearerAuthentication(jwtOptions);
  </code></pre>
  
  <p>I expected that Web API 2 would start returning JWTs from the call to /Token, but it doesn't appear to have done anything. I've been banging my head against this for a few days with no success and the Microsoft documents aren't very forthcoming. </p>
  
  <p>I also tried adding the following to my OAuthAuthorizationServerOptions</p>
  
  <pre><code>AuthorizationCodeFormat = new JwtFormat(audience, new SymmetricKeyIssuerSecurityTokenProvider(issuer, signingKey))
  </code></pre>
  
  <p>I could also be trying to doing the completely wrong thing.</p>
  
  <p>Any ideas would be greatly appreciated.</p>