How to implement OAuth2 authentication in an elegant way
A friend of mine recommended me last week to enhance MicroDMS with some modern authentication mechanisms, so that user can log-in with their Microsoft or Google accounts as well, because as he put, AD is rather old fasioned now.
I wanted a solution where all the configuration is only kept in the backend, and the frontend is completely independent from the underlying authentication mechanism. I decided not to initiate the authentication flow from the frontend but proxy the /authorize endpoint by the backend. This solution works just fine wether the service runs within the ng serve or is behind a reverse proxy.
See how its working: https://demo.microdms.com/
If you are interested, read here how I extended my spvitamin framework with a new module to support oauth2. Everybody is wellcome to further improve the solution and submit a PR in github. :-)