Skip to content

Commit b45a2d2

Browse files
committed
See #289 Fix SettingsBuilder build method in order to fix injectIntoSettings method
1 parent 226795c commit b45a2d2

File tree

2 files changed

+110
-31
lines changed

2 files changed

+110
-31
lines changed

core/src/main/java/com/onelogin/saml2/settings/SettingsBuilder.java

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -239,23 +239,36 @@ public Saml2Settings build(Saml2Settings saml2Setting) {
239239
this.saml2Setting = saml2Setting;
240240

241241
Boolean strict = loadBooleanProperty(STRICT_PROPERTY_KEY);
242-
if (strict != null)
242+
if (strict != null) {
243243
saml2Setting.setStrict(strict);
244+
}
244245

245246
Boolean debug = loadBooleanProperty(DEBUG_PROPERTY_KEY);
246-
if (debug != null)
247+
if (debug != null) {
247248
saml2Setting.setDebug(debug);
249+
}
248250

249251
this.loadSpSetting();
250252
this.loadIdpSetting();
251253
this.loadSecuritySetting();
252254
this.loadCompressSetting();
253255

254-
saml2Setting.setContacts(loadContacts());
256+
List<Contact> contacts = this.loadContacts();
257+
if (!contacts.isEmpty()) {
258+
saml2Setting.setContacts(loadContacts());
259+
}
255260

256-
saml2Setting.setOrganization(loadOrganization());
261+
Organization org = this.loadOrganization();
262+
if (org != null) {
263+
saml2Setting.setOrganization(org);
264+
}
257265

258-
saml2Setting.setUniqueIDPrefix(loadUniqueIDPrefix());
266+
String uniqueIdPrefix = loadUniqueIDPrefix();
267+
if (StringUtils.isNotEmpty(uniqueIdPrefix)) {
268+
saml2Setting.setUniqueIDPrefix(uniqueIdPrefix);
269+
} else if (saml2Setting.getUniqueIDPrefix() == null){
270+
saml2Setting.setUniqueIDPrefix(Util.UNIQUE_ID_PREFIX);
271+
}
259272

260273
return saml2Setting;
261274
}
@@ -265,45 +278,54 @@ public Saml2Settings build(Saml2Settings saml2Setting) {
265278
*/
266279
private void loadIdpSetting() {
267280
String idpEntityID = loadStringProperty(IDP_ENTITYID_PROPERTY_KEY);
268-
if (idpEntityID != null)
281+
if (idpEntityID != null) {
269282
saml2Setting.setIdpEntityId(idpEntityID);
283+
}
270284

271285
URL idpSingleSignOnServiceUrl = loadURLProperty(IDP_SINGLE_SIGN_ON_SERVICE_URL_PROPERTY_KEY);
272-
if (idpSingleSignOnServiceUrl != null)
286+
if (idpSingleSignOnServiceUrl != null) {
273287
saml2Setting.setIdpSingleSignOnServiceUrl(idpSingleSignOnServiceUrl);
288+
}
274289

275290
String idpSingleSignOnServiceBinding = loadStringProperty(IDP_SINGLE_SIGN_ON_SERVICE_BINDING_PROPERTY_KEY);
276-
if (idpSingleSignOnServiceBinding != null)
291+
if (idpSingleSignOnServiceBinding != null) {
277292
saml2Setting.setIdpSingleSignOnServiceBinding(idpSingleSignOnServiceBinding);
293+
}
278294

279295
URL idpSingleLogoutServiceUrl = loadURLProperty(IDP_SINGLE_LOGOUT_SERVICE_URL_PROPERTY_KEY);
280-
if (idpSingleLogoutServiceUrl != null)
296+
if (idpSingleLogoutServiceUrl != null) {
281297
saml2Setting.setIdpSingleLogoutServiceUrl(idpSingleLogoutServiceUrl);
298+
}
282299

283300
URL idpSingleLogoutServiceResponseUrl = loadURLProperty(IDP_SINGLE_LOGOUT_SERVICE_RESPONSE_URL_PROPERTY_KEY);
284-
if (idpSingleLogoutServiceResponseUrl != null)
301+
if (idpSingleLogoutServiceResponseUrl != null) {
285302
saml2Setting.setIdpSingleLogoutServiceResponseUrl(idpSingleLogoutServiceResponseUrl);
303+
}
286304

287305
String idpSingleLogoutServiceBinding = loadStringProperty(IDP_SINGLE_LOGOUT_SERVICE_BINDING_PROPERTY_KEY);
288-
if (idpSingleLogoutServiceBinding != null)
306+
if (idpSingleLogoutServiceBinding != null) {
289307
saml2Setting.setIdpSingleLogoutServiceBinding(idpSingleLogoutServiceBinding);
308+
}
290309

291310
List<X509Certificate> idpX509certMulti = loadCertificateListFromProp(IDP_X509CERTMULTI_PROPERTY_KEY);
292-
if (idpX509certMulti != null)
311+
if (idpX509certMulti != null) {
293312
saml2Setting.setIdpx509certMulti(idpX509certMulti);
313+
}
294314

295315
X509Certificate idpX509cert = loadCertificateFromProp(IDP_X509CERT_PROPERTY_KEY);
296316
if (idpX509cert != null) {
297317
saml2Setting.setIdpx509cert(idpX509cert);
298318
}
299319

300320
String idpCertFingerprint = loadStringProperty(CERTFINGERPRINT_PROPERTY_KEY);
301-
if (idpCertFingerprint != null)
321+
if (idpCertFingerprint != null) {
302322
saml2Setting.setIdpCertFingerprint(idpCertFingerprint);
323+
}
303324

304325
String idpCertFingerprintAlgorithm = loadStringProperty(CERTFINGERPRINT_ALGORITHM_PROPERTY_KEY);
305-
if (idpCertFingerprintAlgorithm != null && !idpCertFingerprintAlgorithm.isEmpty())
326+
if (idpCertFingerprintAlgorithm != null && !idpCertFingerprintAlgorithm.isEmpty()) {
306327
saml2Setting.setIdpCertFingerprintAlgorithm(idpCertFingerprintAlgorithm);
328+
}
307329
}
308330

309331
/**
@@ -376,8 +398,9 @@ private void loadSecuritySetting() {
376398
}
377399

378400
Boolean allowRepeatAttributeName = loadBooleanProperty(SECURITY_ALLOW_REPEAT_ATTRIBUTE_NAME_PROPERTY_KEY);
379-
if (allowRepeatAttributeName != null)
401+
if (allowRepeatAttributeName != null) {
380402
saml2Setting.setAllowRepeatAttributeName(allowRepeatAttributeName);
403+
}
381404
}
382405

383406
/**
@@ -443,40 +466,42 @@ private List<Contact> loadContacts() {
443466
*/
444467
private String loadUniqueIDPrefix() {
445468
String uniqueIDPrefix = loadStringProperty(UNIQUE_ID_PREFIX_PROPERTY_KEY);
446-
if (StringUtils.isNotEmpty(uniqueIDPrefix)) {
447-
return uniqueIDPrefix;
448-
} else {
449-
return Util.UNIQUE_ID_PREFIX;
450-
}
469+
return uniqueIDPrefix;
451470
}
452471

453472
/**
454473
* Loads the SP settings from the properties file
455474
*/
456475
private void loadSpSetting() {
457476
String spEntityID = loadStringProperty(SP_ENTITYID_PROPERTY_KEY);
458-
if (spEntityID != null)
477+
if (spEntityID != null) {
459478
saml2Setting.setSpEntityId(spEntityID);
479+
}
460480

461481
URL assertionConsumerServiceUrl = loadURLProperty(SP_ASSERTION_CONSUMER_SERVICE_URL_PROPERTY_KEY);
462-
if (assertionConsumerServiceUrl != null)
482+
if (assertionConsumerServiceUrl != null) {
463483
saml2Setting.setSpAssertionConsumerServiceUrl(assertionConsumerServiceUrl);
484+
}
464485

465486
String spAssertionConsumerServiceBinding = loadStringProperty(SP_ASSERTION_CONSUMER_SERVICE_BINDING_PROPERTY_KEY);
466-
if (spAssertionConsumerServiceBinding != null)
487+
if (spAssertionConsumerServiceBinding != null) {
467488
saml2Setting.setSpAssertionConsumerServiceBinding(spAssertionConsumerServiceBinding);
489+
}
468490

469491
URL spSingleLogoutServiceUrl = loadURLProperty(SP_SINGLE_LOGOUT_SERVICE_URL_PROPERTY_KEY);
470-
if (spSingleLogoutServiceUrl != null)
492+
if (spSingleLogoutServiceUrl != null) {
471493
saml2Setting.setSpSingleLogoutServiceUrl(spSingleLogoutServiceUrl);
494+
}
472495

473496
String spSingleLogoutServiceBinding = loadStringProperty(SP_SINGLE_LOGOUT_SERVICE_BINDING_PROPERTY_KEY);
474-
if (spSingleLogoutServiceBinding != null)
497+
if (spSingleLogoutServiceBinding != null) {
475498
saml2Setting.setSpSingleLogoutServiceBinding(spSingleLogoutServiceBinding);
499+
}
476500

477501
String spNameIDFormat = loadStringProperty(SP_NAMEIDFORMAT_PROPERTY_KEY);
478-
if (spNameIDFormat != null && !spNameIDFormat.isEmpty())
502+
if (spNameIDFormat != null && !spNameIDFormat.isEmpty()) {
479503
saml2Setting.setSpNameIDFormat(spNameIDFormat);
504+
}
480505

481506
boolean keyStoreEnabled = this.samlData.get(KEYSTORE_KEY) != null && this.samlData.get(KEYSTORE_ALIAS) != null
482507
&& this.samlData.get(KEYSTORE_KEY_PASSWORD) != null;
@@ -496,14 +521,17 @@ private void loadSpSetting() {
496521
spPrivateKey = loadPrivateKeyFromProp(SP_PRIVATEKEY_PROPERTY_KEY);
497522
}
498523

499-
if (spX509cert != null)
524+
if (spX509cert != null) {
500525
saml2Setting.setSpX509cert(spX509cert);
501-
if (spPrivateKey != null)
526+
}
527+
if (spPrivateKey != null) {
502528
saml2Setting.setSpPrivateKey(spPrivateKey);
529+
}
503530

504531
X509Certificate spX509certNew = loadCertificateFromProp(SP_X509CERTNEW_PROPERTY_KEY);
505-
if (spX509certNew != null)
532+
if (spX509certNew != null) {
506533
saml2Setting.setSpX509certNew(spX509certNew);
534+
}
507535
}
508536

509537
/**

core/src/test/java/com/onelogin/saml2/test/settings/IdPMetadataParserTest.java

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
import static org.junit.Assert.assertNull;
66

77
import java.net.URL;
8+
import java.util.List;
89
import java.util.Map;
910

1011
import org.junit.Test;
1112
import org.w3c.dom.Document;
1213
import org.xml.sax.InputSource;
1314

15+
import com.onelogin.saml2.model.Contact;
1416
import com.onelogin.saml2.settings.IdPMetadataParser;
1517
import com.onelogin.saml2.settings.Saml2Settings;
1618
import com.onelogin.saml2.settings.SettingsBuilder;
@@ -211,7 +213,7 @@ public void testParseMultiSameSigningAndEncryptCert() throws Exception {
211213

212214
@Test
213215
public void testInjectIntoSettings() throws Exception {
214-
Saml2Settings setting = new SettingsBuilder().fromFile("config/config.min.properties").build();
216+
Saml2Settings setting = new SettingsBuilder().fromFile("config/config.all.properties").build();
215217

216218
assertEquals("http://idp.example.com/", setting.getIdpEntityId());
217219
assertEquals("http://idp.example.com/simplesaml/saml2/idp/SSOService.php", setting.getIdpSingleSignOnServiceUrl().toString());
@@ -220,6 +222,14 @@ public void testInjectIntoSettings() throws Exception {
220222
assertEquals(setting.getIdpSingleLogoutServiceBinding(), "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect");
221223
assertEquals(Util.loadCert(Util.getFileAsString("certs/certificate1")), setting.getIdpx509cert());
222224
assertEquals(setting.getSpNameIDFormat(), "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");
225+
assertEquals("http://localhost:8080/java-saml-jspsample/metadata.jsp", setting.getSpEntityId());
226+
assertEquals(Constants.RSA_SHA512, setting.getSignatureAlgorithm());
227+
assertEquals(Constants.SHA512, setting.getDigestAlgorithm());
228+
assertEquals(2, setting.getContacts().size());
229+
assertEquals("technical@example.com", setting.getContacts().get(0).getEmailAddress());
230+
assertEquals("support@example.com", setting.getContacts().get(1).getEmailAddress());
231+
assertEquals("SP Java", setting.getOrganization().getOrgName());
232+
assertEquals("EXAMPLE", setting.getUniqueIDPrefix());
223233

224234
Map<String, Object> idpInfo = IdPMetadataParser.parseFileXML("data/metadata/idp/FederationMetadata.xml");
225235
setting = IdPMetadataParser.injectIntoSettings(setting, idpInfo);
@@ -228,11 +238,52 @@ public void testInjectIntoSettings() throws Exception {
228238
assertEquals(setting.getIdpSingleSignOnServiceBinding(), "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect");
229239
assertEquals("https://idp.adfs.example.com/adfs/ls/", setting.getIdpSingleLogoutServiceUrl().toString());
230240
assertEquals(setting.getIdpSingleLogoutServiceBinding(), "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect");
231-
assertEquals(setting.getSpNameIDFormat(), "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
232241
assertEquals(setting.getIdpx509cert(), Util.loadCert(
233242
"MIICZDCCAc2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBPMQswCQYDVQQGEwJ1czEUMBIGA1UECAwLZXhhbXBsZS5jb20xFDASBgNVBAoMC2V4YW1wbGUuY29tMRQwEgYDVQQDDAtleGFtcGxlLmNvbTAeFw0xNzA0MTUxMjI3NTFaFw0yNzA0MTMxMjI3NTFaME8xCzAJBgNVBAYTAnVzMRQwEgYDVQQIDAtleGFtcGxlLmNvbTEUMBIGA1UECgwLZXhhbXBsZS5jb20xFDASBgNVBAMMC2V4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCYtEZ7hGZiNp+NecbcQXosYl8TzVOdL44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PpAqC5MSePyp5/SEX6jxwodQUGRgI5bKILQwOWDrkgfsK1MIeHfovtyqnDZj8e9VwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBKbK4qu7WTLYeQW7OcFAeWcT5D7ujo61QtPf+6eY8hpNntN8yF71vGm+5zdOjmw18igxUrf3W7dLk2wAogXK196WX34x9muorwmFK/HqmKuy0kWWzGcNzZHb0o4Md2Ux7QQVoHqD6dUSqUisOBs34ZPgT5R42LepJTGDEZSkvOxUv9V6fY5dYk8UaWbZ7MQAFi1CnOyybq2nVNjpuxWyJ6SsHQYKRhXa7XGurXFB2mlgcjVj9jxW0gO7djkgRD68b6PNpQmJkbKnkCtJg9YsSeOmuUjwgh4DlcIo5jZocKd5bnLbQ9XKJ3YQHRxFoZbP3BXKrfhVV3vqqzRxMwjZmK"));
245+
assertEquals(setting.getSpNameIDFormat(), "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
246+
assertEquals("http://localhost:8080/java-saml-jspsample/metadata.jsp", setting.getSpEntityId());
247+
assertEquals(Constants.RSA_SHA512, setting.getSignatureAlgorithm());
248+
assertEquals(Constants.SHA512, setting.getDigestAlgorithm());
249+
assertEquals(2, setting.getContacts().size());
250+
assertEquals("technical@example.com", setting.getContacts().get(0).getEmailAddress());
251+
assertEquals("support@example.com", setting.getContacts().get(1).getEmailAddress());
252+
assertEquals("SP Java", setting.getOrganization().getOrgName());
253+
assertEquals("EXAMPLE", setting.getUniqueIDPrefix());
254+
255+
Saml2Settings setting2 = new SettingsBuilder().fromFile("config/config.min.properties").build();
256+
assertEquals("http://idp.example.com/", setting2.getIdpEntityId());
257+
assertEquals("http://idp.example.com/simplesaml/saml2/idp/SSOService.php", setting2.getIdpSingleSignOnServiceUrl().toString());
258+
assertEquals(setting2.getIdpSingleSignOnServiceBinding(), "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect");
259+
assertEquals("http://idp.example.com/simplesaml/saml2/idp/SingleLogoutService.php", setting2.getIdpSingleLogoutServiceUrl().toString());
260+
assertEquals(setting2.getIdpSingleLogoutServiceBinding(), "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect");
261+
assertEquals(Util.loadCert(Util.getFileAsString("certs/certificate1")), setting2.getIdpx509cert());
262+
assertEquals(setting2.getSpNameIDFormat(), "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified");
263+
assertEquals("http://localhost:8080/java-saml-jspsample/metadata.jsp", setting2.getSpEntityId());
264+
assertEquals(Constants.RSA_SHA1, setting2.getSignatureAlgorithm());
265+
assertEquals(Constants.SHA1, setting2.getDigestAlgorithm());
266+
assertEquals(0, setting2.getContacts().size());
267+
assertNull(setting2.getOrganization());
268+
assertEquals(Util.UNIQUE_ID_PREFIX, setting2.getUniqueIDPrefix());
269+
270+
setting2 = IdPMetadataParser.injectIntoSettings(setting2, idpInfo);
271+
assertEquals("http://idp.adfs.example.com/adfs/services/trust", setting2.getIdpEntityId());
272+
assertEquals("https://idp.adfs.example.com/adfs/ls/", setting2.getIdpSingleSignOnServiceUrl().toString());
273+
assertEquals(setting2.getIdpSingleSignOnServiceBinding(), "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect");
274+
assertEquals("https://idp.adfs.example.com/adfs/ls/", setting2.getIdpSingleLogoutServiceUrl().toString());
275+
assertEquals(setting2.getIdpSingleLogoutServiceBinding(), "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect");
276+
assertEquals(setting2.getIdpx509cert(), Util.loadCert(
277+
"MIICZDCCAc2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBPMQswCQYDVQQGEwJ1czEUMBIGA1UECAwLZXhhbXBsZS5jb20xFDASBgNVBAoMC2V4YW1wbGUuY29tMRQwEgYDVQQDDAtleGFtcGxlLmNvbTAeFw0xNzA0MTUxMjI3NTFaFw0yNzA0MTMxMjI3NTFaME8xCzAJBgNVBAYTAnVzMRQwEgYDVQQIDAtleGFtcGxlLmNvbTEUMBIGA1UECgwLZXhhbXBsZS5jb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RDW0QxBXvsRB1jPpIO+JvNcWFpvJrELccD0Fws91LH42j2C4gDNR8JLu5LrUGL6zAIq8NM7wfbwoax9n/0tIZKa6lo6szpXGqiMrDBJPpAqC5MSePyp5/SEX6jxwodQUGRgI5bKILQwOWDrkgfsK1MIeHfovtyqnDZj8e9VwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBKbK4qu7WTLYeQW7OcFAeWcT5D7ujo61QtPf+6eY8hpNntN8yF71vGm+5zdOjmw18igxUrf3W7dLk2wAogXK196WX34x9muorwmFK/HqmKuy0kWWzGcNzZHb0o4Md2Ux7QQVoHqD6dUSqUisOBs34ZPgT5R42LepJTGDEZSkvOxUv9V6fY5dYk8UaWbZ7MQAFi1CnOyybq2nVNjpuxWyJ6SsHQYKRhXa7XGurXFB2mlgcjVj9jxW0gO7djkgRD68b6PNpQmJkbKnkCtJg9YsSeOmuUjwgh4DlcIo5jZocKd5bnLbQ9XKJ3YQHRxFoZbP3BXKrfhVV3vqqzRxMwjZmK"));
280+
assertEquals(setting2.getSpNameIDFormat(), "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");
281+
assertEquals("http://localhost:8080/java-saml-jspsample/metadata.jsp", setting2.getSpEntityId());
282+
assertEquals(Constants.RSA_SHA1, setting2.getSignatureAlgorithm());
283+
assertEquals(Constants.SHA1, setting2.getDigestAlgorithm());
284+
assertEquals(0, setting2.getContacts().size());
285+
assertNull(setting2.getOrganization());
286+
assertEquals(Util.UNIQUE_ID_PREFIX, setting2.getUniqueIDPrefix());
236287
}
237288

238289
}

0 commit comments

Comments
 (0)