ASP.NET Core policy-based authorisation using JSON Web Tokens

Introduction In this post, I am going to demonstrate how JSON Web Tokens (JWTs) can be used in conjunction with ASP.NET Core's new policy-based authorisation model to easily control user access to your Web API controllers and methods. Note: this is a very long tutorial so if you are comfortable working through source code and figuring things out for yourself …

Advertisements

Issuing and authenticating JWT tokens in ASP.NET Core WebAPI – Part II

Big, important announcement regarding ASP.NET Core 2.0 - This tutorial covers requirements for ASP.NET Core 1.x. The principles remain the same, but the implementation is definitely different. If you are interested in seeing what changed between the setup for Core 1.x and Core 2.0, please look at this PR by Nico Jansen on the demo …

Issuing and authenticating JWT tokens in ASP.NET Core WebAPI – Part I

Big, important announcement regarding ASP.NET Core 2.0 - This tutorial covers requirements for ASP.NET Core 1.x. The principles remain the same, but the implementation is definitely different. If you are interested in seeing what changed between the setup for Core 1.x and Core 2.0, please look at this PR by Nico Jansen on the demo …

Mocking DependencyResolver

This may be known to some of you, but I’d never had to do this before, so I thought I’d share. I had some MVC 4 code that explicitly calls the System DependencyResolver (the application uses Unity for dependency injection) to retrieve a service: https://gist.github.com/williamhallatt/751e26ee1ed64b51ea1648eff776c56a Mocking (in this case) the ISomeOtherService is obviously a trivial matter …