
Implementing OpenID Connect Authentication in Angular 19 Without NgModules
Authentication is one of those things that looks simple from the outside and then quickly humbles you once you start wiring it properly. Over the past day, I implemented OpenID Connect authentication in an Angular 19 application using Node v20.18.3. I am not using NgModules. The entire app is built using standalone APIs, which makes things cleaner but also slightly different from older tutorials you may find online. This post walks through the setup, the structure, the issues I ran into, and how I fixed them. Tech stack: Node v20.18.3 Angular 19.2.20 angular auth oidc client Identity Server as the OpenID provider No NgModules. Everything is standalone. Step 1. Install the OIDC client npm install angular-auth-oidc-client This library handles the heavy lifting. Token exchange. Storage. Refresh. State handling. You should not manually handle tokens. Step 2. Configure authentication in app.config.ts Because this is a standalone Angular app, everything is configured using ApplicationConfig.
Continue reading on Dev.to
Opens in a new tab



