This package is a NestJS Module that integrates Keycloak authentication into existing Nibyou Microservices based on NestJS.
You can easily use this package to integrate Keycloak auth in your NestJS Services.
Add the package:
npm i --save @nibyou/keycloak
or
yarn add @nibyou/keycloak
Then you need to add the following configuration to your root .env file:
KEYCLOAK_URL=https://KEYCLOAK.YOURDOMAIN.TLD/auth
KEYCLOAK_REALM=master
KEYCLOAK_CLIENT=master-ui
KEYCLOAK_SECRET=some-very-secure-secret
Poissibly newer env variables can be found here.
In your app.module.ts you can now add:
import { KeycloakModule } from '@nibyou/keycloak'; // <-- the import
@Module({
imports: [
KeycloakModule, // <-- add the module to your app module
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}