Simple JWT authentication in ASP.NET Core 1.0 Web API
<p>I'm looking for the simplest way to setup a Web API server that uses JWTs for authentication in ASP.NET Core (aka ASP.NET 5). This project (<a href="http://www.codeproject.com/Articles/369657/Simple-Authentication-using-Jwt-in-Asp-Net-Web-Api?msg=5199064#xx5199064xx" rel="noreferrer">blog post</a> / <a href="https://github.com/stewartm83/Jwt-WebApi" rel="noreferrer">github</a>) does exactly what I'm looking for but it uses ASP.NET 4.</p>

<p>I just want to be able to:</p>

<ol>
<li><p>setup a login route that can create a JWT token and return it in the header. I'm integrating this with an existing RESTful service that will tell me if the username and password are valid. In the ASP.NET 4 project I'm looking at this could be done with the following route <a href="https://github.com/stewartm83/Jwt-WebApi/blob/master/src/JwtWebApi/Controllers/AccountController.cs#L24-L54" rel="noreferrer">https://github.com/stewartm83/Jwt-WebApi/blob/master/src/JwtWebApi/Controllers/AccountController.cs#L24-L54</a></p></li>
<li><p>Intercept incoming requests to routes that require authorization, decrypt and validate the JWT token coming in the header and make the user information in the JWT token's payload accessible to the route. e.g. something like this: <a href="https://github.com/stewartm83/Jwt-WebApi/blob/master/src/JwtWebApi/App_Start/AuthHandler.cs" rel="noreferrer">https://github.com/stewartm83/Jwt-WebApi/blob/master/src/JwtWebApi/App_Start/AuthHandler.cs</a> </p></li>
</ol>

<p>All of the examples I've seen in ASP.NET Core are very complex and rely on some or all of OAuth, IS, OpenIddict, and EF which I would like to avoid.</p>

<p>Can anyone point me towards an example of how to do this in ASP.NET Core or help me get started with this?</p>

<p><strong>EDIT: Answer</strong>
I ended up using this answer: <a href="https://stackoverflow.com/a/33217340/373655">https://stackoverflow.com/a/33217340/373655</a></p>