ASP.NET Core - Claims Based Authentication: Claims vs Identities vs Principals

With the rise of ASP.NET Core over ASP.NET 4.x, the built in authentication has undergone a shift from role-based access control (RBAC) to claim-based access control (CBAC). The most notable change is the User property on HttpContext is now of type ClaimsPrincipal instead of IPrincipal. Before we get to far ahead of ourselves though, lets start with the basics and build our way up. Claims Claims are the foundation behind claims-based authentication (who would have guessed).

Continue reading ↦

ASP.NET Core - Inversion of Control Container

ASP.NET Core supports dependency injection directly out of the box. For Web APIs this is useful for automatically resolving dependencies needed by controllers, or if you’re a fan of Uncle Bob’s Clean Architecture it can be used to inject external dependencies such as the database into the inner layers. Let’s imagine we’re building an API that has a UserController to provide an endpoint for retrieving users via their numeric id from the database.

Continue reading ↦

Launching a SaaS - Part 2 The Launch

Overview This is the second part of my blog series about launching a Software as a Service (SaaS) product. I intend for this series to be a collection of the lessons I’ve learnt along the way, and is meant to be an educational experience. Because learning new things is one of my motivations there will be times where I explore DIYing portions of the project that should typically be offloaded to a third-party.

Continue reading ↦

WorkStation - Goodbye Windows

I’ve been using Windows for as long as I can remember. Back when Windows 2000 was a big deal I remember using it to play Space Cadet pinball although I was never very good at it. With the rise of Windows 10 it feels as if Microsoft is going downhill and no longer gives you “full control” of your own computer. My biggest gripe with Windows 10 is the automatic updates that it forces upon you.

Continue reading ↦

WorkStation - More RAM

Mo’ RAM, Mo’ Problems I use my laptop for a ton of software development. I’ve been working on launching a SaaS and I often need to have a development build of the backend running along with the frontend. Both of those and a database and I’m easily eating up 5-6 gigabytes of RAM. My laptop is a Dell Inspirion 7559, and it came with 8 gigs of RAM from the factory.

Continue reading ↦

Cherokee Build - 02/03/19

The Cherokee strikes again. A couple weeks back when my exhaust snapped just before the catalytic converter I noticed my muffler had a minor leak. It wasn’t anything major and wasn’t loud so I figured I could probably just run it till spring and deal with it when it was warmer out. The Jeep had other plans though as the leak grew in size, and became extremely obnoxious. Due to the internals of the muffler rusting and coming loose, the muffler developed a horrendous rattle that sounded like a trumpet blasting a low note when at 2300RPM.

Continue reading ↦

TypeScript - Interpolated Strings

Coming from the .NET world String.Format() was by far my most used function for generating user readable error / log messages. After jumping over to TypeScript, I was bummed to learn that no similar function existed. However, it wasn’t so bad, after all console.log() allows us to pass multiple parameters and has no trouble logging them. let foo = { bar: 1 }; console.log('Foo is ', foo); //Prints: Foo is Object { bar : 1 } But this only covers one of the many use cases I used String.

Continue reading ↦

HTTP Status Codes For a RESTful API

Intro Hyper Text Transfer Protocol (HTTP) powers the web. It’s the silent work horse used to carry data between servers and clients, and is the reason why all URLs start with HTTP, or HTTPS. For those new to HTTP, it can be though of as clients (users) making requests that are sent to servers which then reply back with responses. Only servers can make responses, and only clients can make requests.

Continue reading ↦

Cherokee Build - 01/26/19

I’ve honestly been very lucky with my Jeep. My previous daily driver was a 2009 Subaru Legacy, and while it may have been excellent in the snow it had a very high cost of ownership. I figured out that it was costing me on average $100 in maintenance per 1000 miles travelled. It may sound silly to have sold the Subaru and bought a Jeep that was 9 years older but I have zero regrets doing so.

Continue reading ↦

HTTP Cookies

What Are They? HTTP cookies are small bits of text that are included with each HTTP request made from a user’s web browser to web servers. HTTP is a stateless protocol which means each requests is treated as a unique command, and no state data is maintained. Cookies were designed to fill this gap, and allow servers to associate data with user’s as they traverse sites. Cookies are commonly used by sites to hold authentication tokens, tracking ids, or save user preferences.

Continue reading ↦