Skip to content

Commit 3515c64

Browse files
authored
Merge pull request #296 from onelogin/fix-injection
See #289 Fix SettingsBuilder build method in order to fix injectIntoSettings method
2 parents e69b53b + bb74335 commit 3515c64

File tree

2 files changed

+108
-30
lines changed

2 files changed

+108
-30
lines changed

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

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -240,23 +240,36 @@ public Saml2Settings build(Saml2Settings saml2Setting) {
240240
this.saml2Setting = saml2Setting;
241241

242242
Boolean strict = loadBooleanProperty(STRICT_PROPERTY_KEY);
243-
if (strict != null)
243+
if (strict != null) {
244244
saml2Setting.setStrict(strict);
245+
}
245246

246247
Boolean debug = loadBooleanProperty(DEBUG_PROPERTY_KEY);
247-
if (debug != null)
248+
if (debug != null) {
248249
saml2Setting.setDebug(debug);
250+
}
249251

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

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

257-
saml2Setting.setOrganization(loadOrganization());
262+
Organization org = this.loadOrganization();
263+
if (org != null) {
264+
saml2Setting.setOrganization(org);
265+
}
258266

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

261274
return saml2Setting;
262275
}
@@ -266,45 +279,54 @@ public Saml2Settings build(Saml2Settings saml2Setting) {
266279
*/
267280
private void loadIdpSetting() {
268281
String idpEntityID = loadStringProperty(IDP_ENTITYID_PROPERTY_KEY);
269-
if (idpEntityID != null)
282+
if (idpEntityID != null) {
270283
saml2Setting.setIdpEntityId(idpEntityID);
284+
}
271285

272286
URL idpSingleSignOnServiceUrl = loadURLProperty(IDP_SINGLE_SIGN_ON_SERVICE_URL_PROPERTY_KEY);
273-
if (idpSingleSignOnServiceUrl != null)
287+
if (idpSingleSignOnServiceUrl != null) {
274288
saml2Setting.setIdpSingleSignOnServiceUrl(idpSingleSignOnServiceUrl);
289+
}
275290

276291
String idpSingleSignOnServiceBinding = loadStringProperty(IDP_SINGLE_SIGN_ON_SERVICE_BINDING_PROPERTY_KEY);
277-
if (idpSingleSignOnServiceBinding != null)
292+
if (idpSingleSignOnServiceBinding != null) {
278293
saml2Setting.setIdpSingleSignOnServiceBinding(idpSingleSignOnServiceBinding);
294+
}
279295

280296
URL idpSingleLogoutServiceUrl = loadURLProperty(IDP_SINGLE_LOGOUT_SERVICE_URL_PROPERTY_KEY);
281-
if (idpSingleLogoutServiceUrl != null)
297+
if (idpSingleLogoutServiceUrl != null) {
282298
saml2Setting.setIdpSingleLogoutServiceUrl(idpSingleLogoutServiceUrl);
299+
}
283300

284301
URL idpSingleLogoutServiceResponseUrl = loadURLProperty(IDP_SINGLE_LOGOUT_SERVICE_RESPONSE_URL_PROPERTY_KEY);
285-
if (idpSingleLogoutServiceResponseUrl != null)
302+
if (idpSingleLogoutServiceResponseUrl != null) {
286303
saml2Setting.setIdpSingleLogoutServiceResponseUrl(idpSingleLogoutServiceResponseUrl);
304+
}
287305

288306
String idpSingleLogoutServiceBinding = loadStringProperty(IDP_SINGLE_LOGOUT_SERVICE_BINDING_PROPERTY_KEY);
289-
if (idpSingleLogoutServiceBinding != null)
307+
if (idpSingleLogoutServiceBinding != null) {
290308
saml2Setting.setIdpSingleLogoutServiceBinding(idpSingleLogoutServiceBinding);
309+
}
291310

292311
List<X509Certificate> idpX509certMulti = loadCertificateListFromProp(IDP_X509CERTMULTI_PROPERTY_KEY);
293-
if (idpX509certMulti != null)
312+
if (idpX509certMulti != null) {
294313
saml2Setting.setIdpx509certMulti(idpX509certMulti);
314+
}
295315

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

301321
String idpCertFingerprint = loadStringProperty(CERTFINGERPRINT_PROPERTY_KEY);
302-
if (idpCertFingerprint != null)
322+
if (idpCertFingerprint != null) {
303323
saml2Setting.setIdpCertFingerprint(idpCertFingerprint);
324+
}
304325

305326
String idpCertFingerprintAlgorithm = loadStringProperty(CERTFINGERPRINT_ALGORITHM_PROPERTY_KEY);
306-
if (idpCertFingerprintAlgorithm != null && !idpCertFingerprintAlgorithm.isEmpty())
327+
if (idpCertFingerprintAlgorithm != null && !idpCertFingerprintAlgorithm.isEmpty()) {
307328
saml2Setting.setIdpCertFingerprintAlgorithm(idpCertFingerprintAlgorithm);
329+
}
308330
}
309331

310332
/**
@@ -450,40 +472,42 @@ private List<Contact> loadContacts() {
450472
*/
451473
private String loadUniqueIDPrefix() {
452474
String uniqueIDPrefix = loadStringProperty(UNIQUE_ID_PREFIX_PROPERTY_KEY);
453-
if (StringUtils.isNotEmpty(uniqueIDPrefix)) {
454-
return uniqueIDPrefix;
455-
} else {
456-
return Util.UNIQUE_ID_PREFIX;
457-
}
475+
return uniqueIDPrefix;
458476
}
459477

460478
/**
461479
* Loads the SP settings from the properties file
462480
*/
463481
private void loadSpSetting() {
464482
String spEntityID = loadStringProperty(SP_ENTITYID_PROPERTY_KEY);
465-
if (spEntityID != null)
483+
if (spEntityID != null) {
466484
saml2Setting.setSpEntityId(spEntityID);
485+
}
467486

468487
URL assertionConsumerServiceUrl = loadURLProperty(SP_ASSERTION_CONSUMER_SERVICE_URL_PROPERTY_KEY);
469-
if (assertionConsumerServiceUrl != null)
488+
if (assertionConsumerServiceUrl != null) {
470489
saml2Setting.setSpAssertionConsumerServiceUrl(assertionConsumerServiceUrl);
490+
}
471491

472492
String spAssertionConsumerServiceBinding = loadStringProperty(SP_ASSERTION_CONSUMER_SERVICE_BINDING_PROPERTY_KEY);
473-
if (spAssertionConsumerServiceBinding != null)
493+
if (spAssertionConsumerServiceBinding != null) {
474494
saml2Setting.setSpAssertionConsumerServiceBinding(spAssertionConsumerServiceBinding);
495+
}
475496

476497
URL spSingleLogoutServiceUrl = loadURLProperty(SP_SINGLE_LOGOUT_SERVICE_URL_PROPERTY_KEY);
477-
if (spSingleLogoutServiceUrl != null)
498+
if (spSingleLogoutServiceUrl != null) {
478499
saml2Setting.setSpSingleLogoutServiceUrl(spSingleLogoutServiceUrl);
500+
}
479501

480502
String spSingleLogoutServiceBinding = loadStringProperty(SP_SINGLE_LOGOUT_SERVICE_BINDING_PROPERTY_KEY);
481-
if (spSingleLogoutServiceBinding != null)
503+
if (spSingleLogoutServiceBinding != null) {
482504
saml2Setting.setSpSingleLogoutServiceBinding(spSingleLogoutServiceBinding);
505+
}
483506

484507
String spNameIDFormat = loadStringProperty(SP_NAMEIDFORMAT_PROPERTY_KEY);
485-
if (spNameIDFormat != null && !spNameIDFormat.isEmpty())
508+
if (spNameIDFormat != null && !spNameIDFormat.isEmpty()) {
486509
saml2Setting.setSpNameIDFormat(spNameIDFormat);
510+
}
487511

488512
boolean keyStoreEnabled = this.samlData.get(KEYSTORE_KEY) != null && this.samlData.get(KEYSTORE_ALIAS) != null
489513
&& this.samlData.get(KEYSTORE_KEY_PASSWORD) != null;
@@ -503,14 +527,17 @@ private void loadSpSetting() {
503527
spPrivateKey = loadPrivateKeyFromProp(SP_PRIVATEKEY_PROPERTY_KEY);
504528
}
505529

506-
if (spX509cert != null)
530+
if (spX509cert != null) {
507531
saml2Setting.setSpX509cert(spX509cert);
508-
if (spPrivateKey != null)
532+
}
533+
if (spPrivateKey != null) {
509534
saml2Setting.setSpPrivateKey(spPrivateKey);
535+
}
510536

511537
X509Certificate spX509certNew = loadCertificateFromProp(SP_X509CERTNEW_PROPERTY_KEY);
512-
if (spX509certNew != null)
538+
if (spX509certNew != null) {
513539
saml2Setting.setSpX509certNew(spX509certNew);
540+
}
514541
}
515542

516543
/**

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+NecbcQXosYl8TzVOdL44b3Nl+BxL26Bvnt8YNnE63xiQzo7xDdO6+1MWWO26mMxwMpooTToOJgrot9YhlIX1VHIUPbOEGczSmXzCCmMhS26vR/leoLNah8QqCF1UdCoNQejb0fDCy+Q1yEdMXYkBWsFGfDSHSSQIDAQABo1AwTjAdBgNVHQ4EFgQUT1g33aGN0f6BJPgpYbr1pHrMZr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/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+
"MIICZDCCAc2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBPMQswCQYDVQQGEwJ1czEUMBIGA1UECAwLZXhhbXBsZS5jb20xFDASBgNVBAoMC2V4YW1wbGUuY29tMRQwEgYDVQQDDAtleGFtcGxlLmNvbTAeFw0xNzA0MTUxMjI3NTFaFw0yNzA0MTMxMjI3NTFaME8xCzAJBgNVBAYTAnVzMRQwEgYDVQQIDAtleGFtcGxlLmNvbTEUMBIGA1UECgwLZXhhbXBsZS5jb20xFDASBgNVBAMMC2V4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCYtEZ7hGZiNp+NecbcQXosYl8TzVOdL44b3Nl+BxL26Bvnt8YNnE63xiQzo7xDdO6+1MWWO26mMxwMpooTToOJgrot9YhlIX1VHIUPbOEGczSmXzCCmMhS26vR/leo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AA4IBAQBKbK4qu7WTLYeQW7OcFAeWcT5D7ujo61QtPf+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)