Skip to content

Commit 46201ee

Browse files
Merge remote-tracking branch 'origin/4.19'
2 parents f10d9fe + 4459772 commit 46201ee

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

plugins/user-authenticators/saml2/src/main/java/org/apache/cloudstack/saml/SAML2AuthManager.java

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public interface SAML2AuthManager extends PluggableAPIAuthenticator, PluggableSe
7373
ConfigKey<Boolean> SAMLCheckSignature = new ConfigKey<Boolean>("Advanced", Boolean.class, "saml2.check.signature", "true",
7474
"When enabled (default and recommended), SAML2 signature checks are enforced and lack of signature in the SAML SSO response will cause login exception. Disabling this is not advisable but provided for backward compatibility for users who are able to accept the risks.", false);
7575

76+
ConfigKey<Boolean> SAMLForceAuthn = new ConfigKey<Boolean>("Advanced", Boolean.class, "saml2.force.authn", "false",
77+
"When enabled (default false), SAML2 will force a new authentication. This can be useful if multiple application use different saml logins from the same application (I.E. browser)", true);
78+
7679
ConfigKey<String> SAMLUserSessionKeyPathAttribute = new ConfigKey<String>("Advanced", String.class, "saml2.user.sessionkey.path", "",
7780
"The Path attribute of sessionkey cookie when SAML users have logged in. If not set, it will be set to the path of SAML redirection URL (saml2.redirect.url).", true);
7881

plugins/user-authenticators/saml2/src/main/java/org/apache/cloudstack/saml/SAML2AuthManagerImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,6 @@ public ConfigKey<?>[] getConfigKeys() {
541541
SAMLCloudStackRedirectionUrl, SAMLUserAttributeName,
542542
SAMLIdentityProviderMetadataURL, SAMLDefaultIdentityProviderId,
543543
SAMLSignatureAlgorithm, SAMLAppendDomainSuffix, SAMLTimeout, SAMLCheckSignature,
544-
SAMLUserSessionKeyPathAttribute};
544+
SAMLForceAuthn, SAMLUserSessionKeyPathAttribute};
545545
}
546546
}

plugins/user-authenticators/saml2/src/main/java/org/apache/cloudstack/saml/SAMLUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public static AuthnRequest buildAuthnRequestObject(final String authnId, final S
194194
authnRequest.setID(authnId);
195195
authnRequest.setDestination(idpUrl);
196196
authnRequest.setVersion(SAMLVersion.VERSION_20);
197-
authnRequest.setForceAuthn(false);
197+
authnRequest.setForceAuthn(SAML2AuthManager.SAMLForceAuthn.value());
198198
authnRequest.setIsPassive(false);
199199
authnRequest.setIssueInstant(new DateTime());
200200
authnRequest.setProtocolBinding(SAMLConstants.SAML2_POST_BINDING_URI);

ui/tests/unit/components/view/ActionButton.spec.js

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ import mockData from '../../../mockData/ActionButton.mock.json'
2323
import ActionButton from '@/components/view/ActionButton'
2424

2525
jest.mock('axios', () => mockAxios)
26+
jest.mock('@/vue-app', () => ({
27+
vueProps: {
28+
$localStorage: {
29+
set: jest.fn((key, value) => {}),
30+
get: jest.fn((key) => {
31+
return null
32+
})
33+
}
34+
}
35+
}))
2636

2737
let router, store, i18n
2838
const state = {

ui/tests/unit/views/compute/MigrateWizard.spec.js

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ import mockData from '../../../mockData/MigrateWizard.mock'
2323
import MigrateWizard from '@/views/compute/MigrateWizard'
2424

2525
jest.mock('axios', () => mockAxios)
26+
jest.mock('@/vue-app', () => ({
27+
vueProps: {
28+
$localStorage: {
29+
set: jest.fn((key, value) => {}),
30+
get: jest.fn((key) => {
31+
return null
32+
})
33+
}
34+
}
35+
}))
2636

2737
let i18n
2838
let store

0 commit comments

Comments
 (0)