Docker: Bus error/No space left on device

The Issue When starting an application inside a (Linux) Docker container: the first execution results in a simple "Bus error" message to console (for free, no special logging to see this) and crashes the second, subsequent execution results in a "No space left on device" exception (not free, application does exception logging which made this visible) Analysis … Continue reading Docker: Bus error/No space left on device

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 … Continue reading ASP.NET Core policy-based authorisation using JSON Web Tokens

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 … Continue reading Issuing and authenticating JWT tokens in ASP.NET Core WebAPI – Part II

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 … Continue reading Issuing and authenticating JWT tokens in ASP.NET Core WebAPI – Part I

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 … Continue reading Mocking DependencyResolver