diff --git a/docker-compose.yml b/docker-compose.yml index b65e03d..1708e02 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,7 @@ services: - DATABASE_URL=postgresql://postgres:password@postgres:5432/postgres - ALLOWED_ORIGINS=http://localhost:5173,http://localhost:8080,http://krakend:8080 - KEYCLOAK_BASE_URL=http://localhost:8082 + - KEYCLOAK_REALM=referentiel-applications # To be deleted - KEYCLOAK_CLIENT_SECRET="client secret" depends_on: diff --git a/server/src/main.ts b/server/src/main.ts index 7cbed1b..c9eef8f 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -31,8 +31,8 @@ async function bootstrap() { description: 'OAuth2 authentication using Keycloak', flows: { authorizationCode: { - authorizationUrl: `${process.env.KEYCLOAK_BASE_URL}/realms/referentiel-applications/protocol/openid-connect/auth`, - tokenUrl: `${process.env.KEYCLOAK_BASE_URL}/realms/referentiel-applications/protocol/openid-connect/token`, + authorizationUrl: `${process.env.KEYCLOAK_BASE_URL}/realms/${process.env.KEYCLOAK_REALM}/protocol/openid-connect/auth`, + tokenUrl: `${process.env.KEYCLOAK_BASE_URL}/realms/${process.env.KEYCLOAK_REALM}/protocol/openid-connect/token`, scopes: { openid: 'OpenID scope', profile: 'Profile scope',