Posts - page 2

Recent posts

Integrating Keycloak with Aspire - Part 1

September 26, 2024  8 minute read  

In my series on ASP.NET Identity, I mentioned (several times) that you should be using Keycloak, Auth0, Corbado, or another identity service instead of rolling your own. That’s all good, but I left it up to you to figure out exactly how to do that. I thought it would be a good idea to configure an Aspire project from the beginning and show how authentication and authorization with a service works. This article will be more of a “make the code work” type of article, with follow-on articles ...

ASP.NET Identity deep dive - Part 6 (Social logins)

September 20, 2024  11 minute read  

This article is one of a number of articles I will write over the coming month and will go into depth about the ASP.NET Identity system. My outline thus far: Project setup Account registration Signing in and out with a username and password Password reset Email confirmations Social logins Now that I have the basic flows sorted out (which includes username/password with registration, self-service password reset, and account lockout support), it’s time to turn my attention to o...

ASP.NET Identity deep dive - Part 5 (Sending email)

September 18, 2024  12 minute read  

This article is one of a number of articles I will write over the coming month and will go into depth about the ASP.NET Identity system. My outline thus far: Project setup Account registration Signing in and out with a username and password Password reset Email confirmations Social logins Today is the final spot for the basic flows. Up to this point, I’ve been logging links in places where I should be sending emails. Sending emails in development is scary. First, things co...

ASP.NET Identity deep dive - Part 4 (Password reset)

September 16, 2024  7 minute read  

This article is one of a number of articles I will write over the coming month and will go into depth about the ASP.NET Identity system. My outline thus far: Project setup Account registration Signing in and out with a username and password Password reset Email confirmations Social logins I’ve already implemented the registration and login/logout functionality. I’ve also done some updates since the last check in. Most notably, I’ve automatically signed the user in after regis...

ASP.NET Identity deep dive - Part 3 (Authentication)

September 14, 2024  6 minute read  

This article is one of a number of articles I will write over the coming month and will go into depth about the ASP.NET Identity system. My outline thus far: Project setup Account registration Signing in and out with a username and password Password reset Email confirmations Social logins Today, I’m tackling authentication - that is, signing in and out of an account using the web UI. You may remember from my last article that I set up the initial web UI to include a link to ...

ASP.NET Identity deep dive - Part 2 (Registration)

September 13, 2024  13 minute read  

This article is one of a number of articles I will write over the coming month and will go into depth about the ASP.NET Identity system. My outline thus far: Project setup Account registration Signing in and out with a username and password Password reset Email confirmations Social logins As you may remember from the last article, the first user journey I am going to implement is the registration journey. This is actually one of the more complex journeys with several parts t...

ASP.NET Identity deep dive - Part 1 (Project setup)

September 11, 2024  8 minute read  

You may have noticed that I included ASP.NET Identity in a project a couple of posts ago. I’m currently doing a deep dive into ASP.NET Identity with an eye towards an OIDC identity service based on OpenIddict. Identity is a complex topic and I still recommend that developers integrate another service rather than write their own: Keycloak is a good option if you have to store your own data, Auth0 is a good option when you just want a bunch of social providers, Corbado has support for...

.NET Aspire configuration patterns

September 09, 2024  10 minute read  

If you recall my last article, I transitioned my working application to .NET Aspire. This opinionated pattern allows me to run a complete microservice application within Docker Desktop, but then seamlessly deploy to Azure Container Apps and other platform services with the same code base. This is a great productivity boost for a developer. My current project builds an OIDC identity service that has both username/password (local) authentication and social logins like Google and Facebook. To ...

Local development for the cloud: Transitioning to .NET Aspire

September 05, 2024  13 minute read  

I’ve been working on a new project recently. It requires that I work with microservices and containers as it will eventually be runnable on either Kubernetes or (more likely) Azure Container Apps. My latest task is to get ASP.NET Identity working with PostgreSQL. In order to properly debug the code, I need the ASP.NET bits to be running locally. But to integrate with PostgreSQL, I need to set up containers and docker compose. This all feels like “too much work”. Wouldn’t it be amazing if...

Making ASP.NET Core applications readable - the options patterns

September 03, 2024  6 minute read  

Applications are read more often than they are written. The normal situation when a developer comes onto a project is that anything from a couple of weeks to several months is requried to come “up to speed” on the code base. Making the efforts required for readability of the code is important, and I spend a ton of time up front to ensure my applications are understandable without needing an in-depth lesson from me on how it works. Let’s take an application I am starting (today actually). I...