Commit 9181e7e4 authored by michael.simon's avatar michael.simon
Browse files

first changes

parent ccc613b7
......@@ -19,10 +19,8 @@ import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;
import org.opensaml.Configuration;
import org.opensaml.DefaultBootstrap;
import org.opensaml.xml.ConfigurationException;
import org.opensaml.xml.XMLConfigurator;
import org.opensaml.core.config.InitializationException;
import org.opensaml.core.config.InitializationService;
import org.slf4j.Logger;
import edu.kit.scc.webreg.drools.BpmProcessService;
......@@ -132,19 +130,12 @@ public class ApplicationBootstrap {
userService.convertLegacyUsers();
try {
logger.info("OpenSAML Bootstrap...");
DefaultBootstrap.bootstrap();
logger.info("Loading XMLTooling configuration /liberty-paos-config.xml");
XMLConfigurator configurator = new XMLConfigurator();
configurator.load(Configuration.class.getResourceAsStream("/liberty-paos-config.xml"));
} catch (ConfigurationException e) {
try {
logger.info("OpenSAML Bootstrap...");
InitializationService.initialize();
} catch (InitializationException e) {
logger.error("Serious Error happened", e);
}
bpmProcessService.init();
......
......@@ -15,8 +15,8 @@ import java.util.Map;
import java.util.Set;
import org.kie.api.runtime.KieSession;
import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.core.Assertion;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import edu.kit.scc.webreg.entity.GroupEntity;
import edu.kit.scc.webreg.entity.RegistryEntity;
......
......@@ -25,8 +25,8 @@ import org.kie.api.builder.ReleaseId;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;
import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.core.Assertion;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.slf4j.Logger;
import edu.kit.scc.webreg.audit.ServiceRegisterAuditor;
......
......@@ -15,6 +15,7 @@ import java.io.StringWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
......@@ -75,9 +76,9 @@ public class HttpCallbackHook implements UserServiceHook {
if (appConfig.getConfigValue("HttpCallbackHook_positive_match_regex") != null)
positiveMatchRegex = appConfig.getConfigValue("HttpCallbackHook_positive_match_regex");
VelocityEngine engine = new VelocityEngine();
engine.setProperty("runtime.log.logsystem.log4j.logger", "root");
engine.init();
Properties p = new Properties();
p.put("runtime.log.logsystem.log4j.logger", "root");
VelocityEngine engine = new VelocityEngine(p);
Map<String, Object> context = new HashMap<String, Object>();
context.put("user", user);
VelocityContext velocityContext = new VelocityContext(context);
......
......@@ -20,8 +20,8 @@ import javax.ejb.Stateless;
import javax.inject.Inject;
import org.kie.api.runtime.KieSession;
import org.opensaml.saml2.metadata.EntitiesDescriptor;
import org.opensaml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.metadata.EntitiesDescriptor;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.slf4j.Logger;
import edu.kit.scc.webreg.dao.BaseDao;
......
......@@ -15,25 +15,23 @@ import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.servlet.ServletException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.auth.AuthScope;
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.core.Audience;
import org.opensaml.saml2.core.AudienceRestriction;
import org.opensaml.saml2.core.AuthnRequest;
import org.opensaml.saml2.core.Response;
import org.opensaml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml2.metadata.SingleSignOnService;
import org.opensaml.ws.soap.client.BasicSOAPMessageContext;
import org.opensaml.ws.soap.client.SOAPClientException;
import org.opensaml.ws.soap.client.http.HttpClientBuilder;
import org.opensaml.ws.soap.client.http.HttpSOAPClient;
import org.opensaml.ws.soap.common.SOAPException;
import org.opensaml.ws.soap.soap11.Envelope;
import org.opensaml.xml.encryption.DecryptionException;
import org.opensaml.xml.security.SecurityException;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.opensaml.saml.common.xml.SAMLConstants;
import org.opensaml.saml.saml2.core.Assertion;
import org.opensaml.saml.saml2.core.Audience;
import org.opensaml.saml.saml2.core.AudienceRestriction;
import org.opensaml.saml.saml2.core.AuthnRequest;
import org.opensaml.saml.saml2.core.Response;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.metadata.SingleSignOnService;
import org.opensaml.soap.client.SOAPClientException;
import org.opensaml.soap.client.http.HttpSOAPClient;
import org.opensaml.soap.common.SOAPException;
import org.opensaml.soap.soap11.Envelope;
import org.opensaml.xmlsec.encryption.support.DecryptionException;
import org.slf4j.Logger;
import edu.kit.scc.webreg.dao.RegistryDao;
......
......@@ -15,12 +15,11 @@ import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import org.apache.commons.beanutils.PropertyUtils;
import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.core.Response;
import org.opensaml.saml2.metadata.EntityDescriptor;
import org.opensaml.ws.soap.common.SOAPException;
import org.opensaml.xml.encryption.DecryptionException;
import org.opensaml.xml.security.SecurityException;
import org.opensaml.saml.saml2.core.Assertion;
import org.opensaml.saml.saml2.core.Response;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.opensaml.soap.common.SOAPException;
import org.opensaml.xmlsec.encryption.support.DecryptionException;
import org.slf4j.Logger;
import edu.kit.scc.webreg.audit.Auditor;
......
......@@ -25,32 +25,33 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.xml.namespace.QName;
import net.shibboleth.utilities.java.support.xml.BasicParserPool;
import net.shibboleth.utilities.java.support.xml.XMLParserException;
import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.saml2.common.Extensions;
import org.opensaml.saml2.core.Attribute;
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor;
import org.opensaml.saml2.metadata.AttributeService;
import org.opensaml.saml2.metadata.EntitiesDescriptor;
import org.opensaml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml2.metadata.IDPSSODescriptor;
import org.opensaml.saml2.metadata.OrganizationDisplayName;
import org.opensaml.saml2.metadata.SPSSODescriptor;
import org.opensaml.saml2.metadata.SingleSignOnService;
import org.opensaml.samlext.saml2mdattr.EntityAttributes;
import org.opensaml.samlext.saml2mdui.UIInfo;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.io.Unmarshaller;
import org.opensaml.xml.io.UnmarshallerFactory;
import org.opensaml.xml.io.UnmarshallingException;
import org.opensaml.xml.parse.BasicParserPool;
import org.opensaml.xml.parse.XMLParserException;
import org.opensaml.xml.schema.XSAny;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.io.Unmarshaller;
import org.opensaml.core.xml.io.UnmarshallerFactory;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.core.xml.schema.XSAny;
import org.opensaml.saml.common.xml.SAMLConstants;
import org.opensaml.saml.ext.saml2mdattr.EntityAttributes;
import org.opensaml.saml.ext.saml2mdui.UIInfo;
import org.opensaml.saml.saml2.core.Attribute;
import org.opensaml.saml.saml2.metadata.AttributeAuthorityDescriptor;
import org.opensaml.saml.saml2.metadata.AttributeService;
import org.opensaml.saml.saml2.metadata.EntitiesDescriptor;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.metadata.Extensions;
import org.opensaml.saml.saml2.metadata.IDPSSODescriptor;
import org.opensaml.saml.saml2.metadata.OrganizationDisplayName;
import org.opensaml.saml.saml2.metadata.SPSSODescriptor;
import org.opensaml.saml.saml2.metadata.SingleSignOnService;
import org.slf4j.Logger;
import org.w3c.dom.Document;
......@@ -211,7 +212,7 @@ public class MetadataHelper implements Serializable {
List<OrganizationDisplayName> displayList = entityDesc.getOrganization().getDisplayNames();
if (displayList.size() > 0)
return displayList.get(0).getName().getLocalString();
return displayList.get(0).getValue();
else
return entityDesc.getEntityID();
}
......@@ -256,13 +257,13 @@ public class MetadataHelper implements Serializable {
UIInfo uiInfo = (UIInfo) xmlObject;
if (uiInfo.getDescriptions().size() > 0) {
idp.setDescription(uiInfo.getDescriptions().get(0).getName().getLocalString());
idp.setDescription(uiInfo.getDescriptions().get(0).getValue());
}
if (uiInfo.getDisplayNames().size() > 0) {
idp.setDisplayName(uiInfo.getDisplayNames().get(0).getName().getLocalString());
idp.setDisplayName(uiInfo.getDisplayNames().get(0).getValue());
}
if (uiInfo.getInformationURLs().size() > 0) {
idp.setInformationUrl(uiInfo.getInformationURLs().get(0).getURI().getLocalString());
idp.setInformationUrl(uiInfo.getInformationURLs().get(0).getValue());
}
}
}
......
......@@ -14,16 +14,18 @@ import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.servlet.http.HttpServletResponse;
import org.opensaml.common.SAMLObject;
import org.opensaml.common.binding.BasicSAMLMessageContext;
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.saml2.binding.encoding.HTTPRedirectDeflateEncoder;
import org.opensaml.saml2.core.AuthnRequest;
import org.opensaml.saml2.core.NameID;
import org.opensaml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml2.metadata.SingleSignOnService;
import org.opensaml.ws.message.encoder.MessageEncodingException;
import org.opensaml.ws.transport.http.HttpServletResponseAdapter;
import org.opensaml.messaging.context.MessageContext;
import org.opensaml.messaging.encoder.MessageEncoder;
import org.opensaml.messaging.encoder.MessageEncodingException;
import org.opensaml.profile.action.MessageEncoderFactory;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.messaging.context.SAMLBindingContext;
import org.opensaml.saml.common.xml.SAMLConstants;
import org.opensaml.saml.saml2.binding.encoding.impl.HTTPRedirectDeflateEncoder;
import org.opensaml.saml.saml2.core.AuthnRequest;
import org.opensaml.saml.saml2.core.NameID;
import org.opensaml.saml.saml2.metadata.EntityDescriptor;
import org.opensaml.saml.saml2.metadata.SingleSignOnService;
import org.slf4j.Logger;
import edu.kit.scc.webreg.entity.SamlIdpMetadataEntity;
......@@ -56,13 +58,14 @@ public class Saml2RedirectService {
spEntity.getEntityId(), spEntity.getAcs(), SAMLConstants.SAML2_POST_BINDING_URI);
logger.debug("Sending client to idp {} endpoint {}", idpEntity.getEntityId(), sso.getLocation());
MessageContext<AuthnRequest> messageContext = new MessageContext<AuthnRequest>();
SAMLBindingContext bindingContext = new SAMLBindingContext();
bindingContext.setBindingDescriptor(sso);
HTTPRedirectDeflateEncoder encoder = new HTTPRedirectDeflateEncoder();
BasicSAMLMessageContext<SAMLObject, AuthnRequest, NameID> messageContext =
new BasicSAMLMessageContext<SAMLObject, AuthnRequest, NameID>();
messageContext.setOutboundSAMLMessage(authnRequest);
messageContext.setPeerEntityEndpoint(sso);
messageContext.setOutboundMessageTransport(new HttpServletResponseAdapter(response, true));
messageContext.setMessage(authnRequest);
messageContext. setPeerEntityEndpoint(sso);
//messageContext.setOutboundMessageTransport(new HttpServletResponseAdapter(response, true));
encoder.encode(messageContext);
}
......
......@@ -24,25 +24,24 @@ import javax.inject.Inject;
import javax.inject.Named;
import javax.xml.namespace.QName;
import org.opensaml.Configuration;
import org.opensaml.common.impl.SecureRandomIdentifierGenerator;
import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.core.Attribute;
import org.opensaml.saml2.core.AttributeStatement;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.XMLObjectBuilder;
import org.opensaml.xml.io.Marshaller;
import org.opensaml.xml.io.MarshallerFactory;
import org.opensaml.xml.io.MarshallingException;
import org.opensaml.xml.io.Unmarshaller;
import org.opensaml.xml.io.UnmarshallerFactory;
import org.opensaml.xml.io.UnmarshallingException;
import org.opensaml.xml.parse.BasicParserPool;
import org.opensaml.xml.parse.XMLParserException;
import org.opensaml.xml.schema.XSAny;
import org.opensaml.xml.schema.XSDateTime;
import org.opensaml.xml.schema.XSString;
import org.opensaml.xml.util.XMLHelper;
import net.shibboleth.utilities.java.support.xml.BasicParserPool;
import net.shibboleth.utilities.java.support.xml.XMLParserException;
import org.opensaml.core.config.Configuration;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.XMLObjectBuilder;
import org.opensaml.core.xml.io.Marshaller;
import org.opensaml.core.xml.io.MarshallerFactory;
import org.opensaml.core.xml.io.MarshallingException;
import org.opensaml.core.xml.io.Unmarshaller;
import org.opensaml.core.xml.io.UnmarshallerFactory;
import org.opensaml.core.xml.io.UnmarshallingException;
import org.opensaml.core.xml.schema.XSAny;
import org.opensaml.core.xml.schema.XSDateTime;
import org.opensaml.core.xml.schema.XSString;
import org.opensaml.saml.saml2.core.Assertion;
import org.opensaml.saml.saml2.core.Attribute;
import org.opensaml.saml.saml2.core.AttributeStatement;
import org.slf4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
......
......@@ -17,10 +17,10 @@ import javax.inject.Inject;
import javax.inject.Named;
import org.joda.time.DateTime;
import org.opensaml.common.SAMLVersion;
import org.opensaml.saml2.core.AuthnRequest;
import org.opensaml.saml2.core.Issuer;
import org.opensaml.saml2.core.NameIDPolicy;
import org.opensaml.saml.common.SAMLVersion;
import org.opensaml.saml.saml2.core.AuthnRequest;
import org.opensaml.saml.saml2.core.Issuer;
import org.opensaml.saml.saml2.core.NameIDPolicy;
@Named("ssoHelper")
@ApplicationScoped
......
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