From 42784fabf765b0d3ca57b3a03a23bdb236044115 Mon Sep 17 00:00:00 2001 From: Luis Cruz Date: Fri, 4 Sep 2020 13:59:43 +0100 Subject: [PATCH] Init SAML DecryptionParserPool (#372) --- bennu-saml-client/pom.xml | 11 +++++++++++ .../org/fenixedu/bennu/saml/client/SAMLClientSDK.java | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/bennu-saml-client/pom.xml b/bennu-saml-client/pom.xml index b7fbc9073..0e8fbfdb7 100644 --- a/bennu-saml-client/pom.xml +++ b/bennu-saml-client/pom.xml @@ -44,6 +44,17 @@ pac4j-saml-opensamlv3 ${pac4j.version} + + org.apache.wss4j + wss4j-ws-security-common + 2.3.0 + + + org.apache.geronimo.specs + geronimo-javamail_1.4_spec + + + diff --git a/bennu-saml-client/src/main/java/org/fenixedu/bennu/saml/client/SAMLClientSDK.java b/bennu-saml-client/src/main/java/org/fenixedu/bennu/saml/client/SAMLClientSDK.java index 117bf40d5..41bc9c734 100644 --- a/bennu-saml-client/src/main/java/org/fenixedu/bennu/saml/client/SAMLClientSDK.java +++ b/bennu-saml-client/src/main/java/org/fenixedu/bennu/saml/client/SAMLClientSDK.java @@ -1,10 +1,13 @@ package org.fenixedu.bennu.saml.client; +import org.opensaml.core.config.ConfigurationService; import org.opensaml.core.xml.schema.XSAny; import org.opensaml.core.xml.schema.impl.XSAnyBuilder; import org.opensaml.saml.common.xml.SAMLConstants; +import org.opensaml.xmlsec.config.DecryptionParserPool; import org.pac4j.saml.client.SAML2Client; import org.pac4j.saml.config.SAML2Configuration; +import org.apache.wss4j.common.saml.OpenSAMLUtil; import javax.xml.namespace.QName; import java.io.File; @@ -98,6 +101,8 @@ private static SAML2Configuration getNewConfiguration(String[] govAttributesToRe static { CLIENT.setCallbackUrl(SAMLClientConfiguration.getConfiguration().callbackUrl()); + + ConfigurationService.register(DecryptionParserPool.class, new DecryptionParserPool(OpenSAMLUtil.getParserPool())); } public static SAML2Client getClient() {