Commit 20d0ef74 authored by michael.simon's avatar michael.simon
Browse files

small steps forward

parent 344ddfe3
......@@ -17,8 +17,6 @@ import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClients;
import org.joda.time.DateTime;
......@@ -35,6 +33,7 @@ import org.opensaml.saml.saml2.core.Response;
import org.opensaml.saml.saml2.core.Subject;
import org.opensaml.saml.saml2.metadata.AttributeService;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.opensaml.soap.messaging.context.SOAP11Context;
import org.opensaml.soap.soap11.Body;
import org.opensaml.soap.soap11.Envelope;
import org.slf4j.Logger;
......@@ -70,14 +69,17 @@ public class AttributeQueryHelper implements Serializable {
AttributeQuery attrQuery = buildAttributeQuery(
persistentId, spEntity.getEntityId());
//Envelope envelope = buildSOAP11Envelope(attrQuery);
Envelope envelope = buildSOAP11Envelope(attrQuery);
MessageContext<SAMLObject> inbound = new MessageContext<SAMLObject>();
MessageContext<SAMLObject> outbound = new MessageContext<SAMLObject>();
outbound.setMessage(attrQuery);
InOutOperationContext<SAMLObject, SAMLObject> inOutContext =
new InOutOperationContext<SAMLObject, SAMLObject>(inbound, outbound);
MessageContext<Envelope> outbound = new MessageContext<Envelope>();
outbound.setMessage(envelope);
SOAP11Context soapContext = new SOAP11Context();
soapContext.setEnvelope(envelope);
outbound.addSubcontext(soapContext);
InOutOperationContext<SAMLObject, Envelope> inOutContext =
new InOutOperationContext<SAMLObject, Envelope>(inbound, outbound);
// BasicSOAPMessageContext soapContext = new BasicSOAPMessageContext();
// soapContext.setOutboundMessage(envelope);
......
......@@ -129,6 +129,7 @@ public class Saml2ResponseValidationService {
throw new SamlAuthenticationException("No Signature on SignableSamlObject");
DOMMetadataResolver mp = new DOMMetadataResolver(entityDescriptor.getDOM());
mp.setId(entityDescriptor.getEntityID() + "-resolver");
try {
mp.initialize();
} catch (ComponentInitializationException e) {
......
......@@ -24,6 +24,7 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.xml.namespace.QName;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.xml.BasicParserPool;
import net.shibboleth.utilities.java.support.xml.SerializeSupport;
import net.shibboleth.utilities.java.support.xml.XMLParserException;
......@@ -70,6 +71,11 @@ public class SamlHelper implements Serializable {
public void init() {
basicParserPool = new BasicParserPool();
basicParserPool.setNamespaceAware(true);
try {
basicParserPool.initialize();
} catch (ComponentInitializationException e) {
logger.error("Init of ParserPool failed", e);
}
XMLObjectProviderRegistry registry;
synchronized(ConfigurationService.class) {
......@@ -83,6 +89,7 @@ public class SamlHelper implements Serializable {
marshallerFactory = registry.getMarshallerFactory();
unmarshallerFactory = registry.getUnmarshallerFactory();
builderFactory = registry.getBuilderFactory();
}
public String getRandomId() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment