From 938eecfb62e8404aa535f1a7977a2ddb3de0bad4 Mon Sep 17 00:00:00 2001 From: Slawomir Wieczorek Date: Mon, 13 Jan 2025 13:39:18 +0100 Subject: [PATCH] HELLODATA-1881 - configurable token scope --- .../hello-data-portal-ui/src/app/auth/auth-config.module.ts | 2 +- .../hello-data-portal-ui/src/environments/env.model.ts | 1 + .../hello-data-portal-ui/src/environments/environment.dev.ts | 3 ++- .../hello-data-portal-ui/src/environments/environment.e2e.ts | 3 ++- .../hello-data-portal-ui/src/environments/environment.prod.ts | 3 ++- .../hello-data-portal-ui/src/environments/environment.ts | 3 ++- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hello-data-portal/hello-data-portal-ui/src/app/auth/auth-config.module.ts b/hello-data-portal/hello-data-portal-ui/src/app/auth/auth-config.module.ts index cf45d07d..94dc14dc 100644 --- a/hello-data-portal/hello-data-portal-ui/src/app/auth/auth-config.module.ts +++ b/hello-data-portal/hello-data-portal-ui/src/app/auth/auth-config.module.ts @@ -43,7 +43,7 @@ export class AuthConfigService { redirectUrl: `${environment.authConfig.redirectUrl}/callback`, postLogoutRedirectUri: environment.authConfig.postLogoutRedirectUri, clientId: environment.authConfig.clientId, - scope: 'openid profile email', + scope: environment.authConfig.scope, responseType: 'code', silentRenew: true, silentRenewUrl: `${window.location.origin}/silent-renew.html`, diff --git a/hello-data-portal/hello-data-portal-ui/src/environments/env.model.ts b/hello-data-portal/hello-data-portal-ui/src/environments/env.model.ts index 1d554657..a2e4bb21 100644 --- a/hello-data-portal/hello-data-portal-ui/src/environments/env.model.ts +++ b/hello-data-portal/hello-data-portal-ui/src/environments/env.model.ts @@ -55,6 +55,7 @@ export interface AuthConfig { clientId: string; redirectUrl: string; postLogoutRedirectUri: string; + scope: string; } export interface DeploymentConfig { diff --git a/hello-data-portal/hello-data-portal-ui/src/environments/environment.dev.ts b/hello-data-portal/hello-data-portal-ui/src/environments/environment.dev.ts index 43aaeb14..1c0eb905 100644 --- a/hello-data-portal/hello-data-portal-ui/src/environments/environment.dev.ts +++ b/hello-data-portal/hello-data-portal-ui/src/environments/environment.dev.ts @@ -46,7 +46,8 @@ export const environment: Environment = window.environment != undefined ? window authority: 'http://localhost:38080/realms/hellodata', redirectUrl: 'http://localhost:4200', postLogoutRedirectUri: 'http://localhost:4200', - clientId: 'frontend-client' + clientId: 'frontend-client', + scope: 'openid profile email' }, deploymentEnvironment: { name: 'DEV', diff --git a/hello-data-portal/hello-data-portal-ui/src/environments/environment.e2e.ts b/hello-data-portal/hello-data-portal-ui/src/environments/environment.e2e.ts index 31f9b324..91b7ee3b 100644 --- a/hello-data-portal/hello-data-portal-ui/src/environments/environment.e2e.ts +++ b/hello-data-portal/hello-data-portal-ui/src/environments/environment.e2e.ts @@ -45,7 +45,8 @@ export const environment: Environment = window.environment != undefined ? window authority: 'http://hellodata-portal-keycloak:8080/realms/hellodata', redirectUrl: 'http://hellodata-portal-ui:80/', postLogoutRedirectUri: 'http://hellodata-portal-ui:80/', - clientId: 'frontend-client' + clientId: 'frontend-client', + scope: 'openid profile email' }, deploymentEnvironment: { name: 'DEV' diff --git a/hello-data-portal/hello-data-portal-ui/src/environments/environment.prod.ts b/hello-data-portal/hello-data-portal-ui/src/environments/environment.prod.ts index 995d348b..05258a5a 100644 --- a/hello-data-portal/hello-data-portal-ui/src/environments/environment.prod.ts +++ b/hello-data-portal/hello-data-portal-ui/src/environments/environment.prod.ts @@ -45,7 +45,8 @@ export const environment: Environment = window.environment != undefined ? window authority: '--configure me--', redirectUrl: '--configure me--', postLogoutRedirectUri: '--configure me--', - clientId: '--configure me--' + clientId: '--configure me--', + scope: 'openid profile email' }, deploymentEnvironment: { name: 'PROD' diff --git a/hello-data-portal/hello-data-portal-ui/src/environments/environment.ts b/hello-data-portal/hello-data-portal-ui/src/environments/environment.ts index 8eb4865e..1255247a 100644 --- a/hello-data-portal/hello-data-portal-ui/src/environments/environment.ts +++ b/hello-data-portal/hello-data-portal-ui/src/environments/environment.ts @@ -45,7 +45,8 @@ export const environment: Environment = window.environment != undefined ? window authority: '', redirectUrl: '', postLogoutRedirectUri: '', - clientId: '' + clientId: '', + scope: 'openid profile email' }, deploymentEnvironment: { showEnvironment: true,