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