Skip to main content

Concern

Authentication middleware and strategies (pluggable auth).

Technology

Passport (@nestjs/passport)

Documentation

Integration

framework / NestJS

Use @nestjs/passport and guards in controller-layer. Strategies (e.g. local, JWT) provide sessions/tokens for API auth. Pair with jwt for token-based strategies and password-hashing for local (username/password) strategies.

Google SSO and Microsoft SSO

Same find-or-create + JWT + redirect flow for both; when a provider's env vars are empty, a guard returns 501 and the strategy uses placeholder credentials so the app starts. See capability auth for the full flow.