Skip to content

Commit 30744e0

Browse files
HejdaJakubxkostka2
authored andcommitted
fix: add new defaul acr value
* There is a new option to define default acr value in config file. * The default value of this property enables to correctly handle information about already performed mfa - if the idp requires mfa by itself, Perun applications should skip its own mfa logic, because user already has valid mfa session on proxy. BREAKING CHANGE: new string property oauth_acr_value in defaultConfig.json
1 parent 19174b5 commit 30744e0

File tree

8 files changed

+17
-7
lines changed

8 files changed

+17
-7
lines changed

apps/admin-gui/src/assets/config/defaultConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"oauth_redirect_uri": "http://localhost:4200/api-callback",
2121
"oauth_scopes": "openid profile perun_api perun_admin offline_access",
2222
"oauth_response_type": "code",
23-
"oauth_offline_access_consent_prompt": true
23+
"oauth_offline_access_consent_prompt": true,
24+
"oauth_acr_value": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport https://refeds.org/profile/sfa https://refeds.org/profile/mfa"
2425
},
2526
"proxy_logout": true,
2627
"mfa": {

apps/consolidator/src/assets/config/defaultConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"oauth_scopes": "openid profile perun_api perun_admin offline_access target user_identifiers",
1212
"oauth_response_type": "code",
1313
"user_info_endpoint_url": "https://proxy.aai.muni.cz/OIDC/userinfo",
14-
"oauth_offline_access_consent_prompt": true
14+
"oauth_offline_access_consent_prompt": true,
15+
"oauth_acr_value": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport https://refeds.org/profile/sfa https://refeds.org/profile/mfa"
1516
},
1617
"proxy_logout": true,
1718
"mfa": {

apps/linker/src/assets/config/defaultConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"oauth_load_user_info": true,
1111
"oauth_scopes": "openid profile perun_api offline_access target user_identifiers",
1212
"oauth_response_type": "code",
13-
"oauth_offline_access_consent_prompt": true
13+
"oauth_offline_access_consent_prompt": true,
14+
"oauth_acr_value": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport https://refeds.org/profile/sfa https://refeds.org/profile/mfa"
1415
},
1516
"mfa": {
1617
"url_en": "https://mfa.id.muni.cz/"

apps/password-reset/src/assets/config/defaultConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"oauth_redirect_uri": "http://localhost:4200/api-callback",
1313
"oauth_scopes": "openid profile perun_api offline_access",
1414
"oauth_response_type": "code",
15-
"oauth_offline_access_consent_prompt": true
15+
"oauth_offline_access_consent_prompt": true,
16+
"oauth_acr_value": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport https://refeds.org/profile/sfa https://refeds.org/profile/mfa"
1617
},
1718
"mfa": {
1819
"url_en": "https://mfa.id.muni.cz/"

apps/publications/src/assets/config/defaultConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"oauth_redirect_uri": "http://localhost:4200/api-callback",
1212
"oauth_scopes": "openid profile perun_api perun_admin offline_access",
1313
"oauth_response_type": "code",
14-
"oauth_offline_access_consent_prompt": true
14+
"oauth_offline_access_consent_prompt": true,
15+
"oauth_acr_value": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport https://refeds.org/profile/sfa https://refeds.org/profile/mfa"
1516
},
1617
"proxy_logout": true,
1718
"mfa": {

apps/user-profile/src/assets/config/defaultConfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"oauth_redirect_uri": "http://localhost:4200/api-callback",
1919
"oauth_scopes": "openid profile perun_api offline_access",
2020
"oauth_response_type": "code",
21-
"oauth_offline_access_consent_prompt": true
21+
"oauth_offline_access_consent_prompt": true,
22+
"oauth_acr_value": "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport https://refeds.org/profile/sfa https://refeds.org/profile/mfa"
2223
},
2324
"proxy_logout": true,
2425
"password_namespace_attributes": [

libs/perun/models/src/lib/ConfigProperties.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface OidcClient {
99
user_info_endpoint_url: string;
1010
filters: Record<string, string>;
1111
oauth_offline_access_consent_prompt: boolean;
12+
oauth_acr_value: string;
1213
}
1314

1415
interface PerunTheme {

libs/perun/services/src/lib/auth.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ export class AuthService {
103103
//So the refreshing of the token is not triggered by multiple tabs at the same time
104104
const timeoutFactor = 0.5 + randomSalt;
105105

106-
const customQueryParams = !filterValue ? {} : { acr_values: filterValue };
107106
const oidcClientProperties: OidcClient = this.store.getProperty('oidc_client');
107+
const acr = oidcClientProperties.oauth_acr_value;
108+
const customQueryParams = !filterValue
109+
? { acr_values: acr }
110+
: { acr_values: filterValue + ' ' + acr };
108111
if (
109112
oidcClientProperties.oauth_scopes.split(' ').includes('offline_access') &&
110113
oidcClientProperties.oauth_offline_access_consent_prompt

0 commit comments

Comments
 (0)