Skip to content

Commit

Permalink
fix(linker): fixed prompt
Browse files Browse the repository at this point in the history
* 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'
  • Loading branch information
xkureck committed Aug 18, 2022
1 parent dfd8909 commit 3960899
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/linker/src/assets/config/defaultConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
12 changes: 10 additions & 2 deletions libs/perun/services/src/lib/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3960899

Please sign in to comment.