Identity API endpoints
In this section, we’ll talk about one of the most anticipated features of .NET 8: a convenient set of helpers that can be used by developers to add identity-related, REST-based endpoints to any ASP.NET Core app with (very) few lines of code. These endpoints have been specifically designed to be called by SPAs, providing them with access tokens that can be used to grant authentication and authorization rights.
On paper, we could say that these endpoints definitely seem a good fit for our scenario; we do have an SPA app that requires authentication and authorization rights, and finding a way to provide those access tokens is what we did throughout the first half of this chapter. Why did we do all this if there was a convenient built-in feature that could relieve us from all that work?
To properly answer this question, we are going to take a look at this new feature with the aim of understanding its pros and cons; as always, the best way to do that...