Middleware for validating Keycloak tokens in NestJS applications.
npm install athenea-keycloak-validation
import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common';
import { AppsModule } from './apps/apps.module';
import { AtheneaKeycloakValidationService } from 'athenea-keycloak-validation';
@Module({
imports: [
AppsModule
],
})
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer
.apply(AtheneaKeycloakValidationService)
.forRoutes('*')
}
}
Ensure to provide the OpenID Connect configuration URL in the openidConfigUrl
environment variable.
ISC