From 396089945f8f7934f3c31f0e6f4434b0c15f4b25 Mon Sep 17 00:00:00 2001 From: xkureck Date: Thu, 18 Aug 2022 15:08:57 +0200 Subject: [PATCH] fix(linker): fixed prompt * when we want to prompt login but we still want to do the offline access then in the customQueryParams['prompt'] needs to be both 'login' and 'prompt' so in the end the value needs to be 'prompt login' --- apps/linker/src/assets/config/defaultConfig.json | 2 +- libs/perun/services/src/lib/auth.service.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/linker/src/assets/config/defaultConfig.json b/apps/linker/src/assets/config/defaultConfig.json index e473ef618..39c89cbe7 100644 --- a/apps/linker/src/assets/config/defaultConfig.json +++ b/apps/linker/src/assets/config/defaultConfig.json @@ -8,7 +8,7 @@ "oauth_post_logout_redirect_uri": "", "oauth_redirect_uri": "http://localhost:4201/api-callback", "oauth_load_user_info": true, - "oauth_scopes": "openid profile perun_api perun_admin target user_identifiers", + "oauth_scopes": "openid profile perun_api offline_access target user_identifiers", "oauth_response_type": "code", "oauth_offline_access_consent_prompt": true }, diff --git a/libs/perun/services/src/lib/auth.service.ts b/libs/perun/services/src/lib/auth.service.ts index 954687e4a..ee8c50aa5 100644 --- a/libs/perun/services/src/lib/auth.service.ts +++ b/libs/perun/services/src/lib/auth.service.ts @@ -59,11 +59,19 @@ export class AuthService { } if (sessionStorage.getItem('mfa_route')) { customQueryParams['acr_values'] = 'https://refeds.org/profile/mfa'; - customQueryParams['prompt'] = 'login'; + if (customQueryParams['prompt']) { + customQueryParams['prompt'] += ' login'; + } else { + customQueryParams['prompt'] = 'login'; + } customQueryParams['max_age'] = '0'; } if (this.store.getProperty('application') === 'Linker') { - customQueryParams['prompt'] = 'login'; + if (customQueryParams['prompt']) { + customQueryParams['prompt'] += ' login'; + } else { + customQueryParams['prompt'] = 'login'; + } const selectedIdP = parseQueryParams('idphint', location.search.substring(1)); if (selectedIdP) { customQueryParams['idphint'] = selectedIdP;