An increasingly common Single Page Application (SPA) client with server API backend solution is angular 2/4 with asp.net core API. I especially like the approach by Michal Dymel where he creates 2 projects, asp.net core server and angular client. Each project has its own tool set: I use Visual Studio Community Edition for the asp.net core server, and use angular command line interface (CLI) and Visual Studio Code for the client. The angular cli allows for quick scaffolding of client projects, as well as components, directives, services, classes, routing… When the angular-cli is built (ng build), the files are copied to a destination set in the configuration, and in this case to asp.net core wwwroot folder. Works great.
However, authentication and authorization continue to be road blocks for me. I have a server and can write code, manage databases and do not want to offload to a Saas solution. Maybe I’ll implement an Identity Server solution at some point, but for now I want quick, light-weight set-ups, that do not get in the way of the core applications I want to write.
When I used Asp.net MVC, the authentication solution was available out of the box – simple and easy. Tokens (JWT) are now the rage for spa client-server, but with this I need to write all my own authentication/login in my client for each client app, and then get the JWT token, client claims to my api calls…
We’ll see how this works. I plan to blog my experience implementing this in my next post.