Implementing authentication in Angular
In order to handle JWT-based token authentication, we need to set up our ASP.NET back-end and our Angular front-end to handle all the required tasks.
In the previous sections, we spent a good amount of time configuring the .NET Core Identity services as well as IdentityServer
, meaning that we're halfway done; as a matter of fact, we're almost done with the server-side tasks. At the same time, we did nothing at the front-end level: the two users that we created in the previous section—admin@email.com
and user@email.com
—have no way to log in, and there isn't a registration form for creating new users.
Now, here's some (very) good news: the Visual Studio Angular template that we used to set up our apps comes with built-in support for the auth API that we've just added to our back-end, and the best part of it is that it actually works very well!
However, we've also got some bad news: since we...