aboutsummaryrefslogtreecommitdiff
path: root/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-21 14:38:35 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-27 16:38:56 +0100
commit9cb68043945f53246928443cea723b58ee2b1c24 (patch)
treec612cb928452d27d6fc5e3014d5f044fac643b22 /id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
parent6c7a6f8e222e4fb39a11c220b63e785f2037d428 (diff)
downloadmoa-id-spss-9cb68043945f53246928443cea723b58ee2b1c24.tar.gz
moa-id-spss-9cb68043945f53246928443cea723b58ee2b1c24.tar.bz2
moa-id-spss-9cb68043945f53246928443cea723b58ee2b1c24.zip
updated samlengine
Diffstat (limited to 'id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java')
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java23
1 files changed, 17 insertions, 6 deletions
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
index f8f50fc74..48718242b 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/SAMLEngine.java
@@ -50,8 +50,11 @@ import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
import eu.stork.peps.auth.engine.core.STORKSAMLCore;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryMarshaller;
+import eu.stork.peps.auth.engine.core.impl.CustomAttributeQueryUnmarshaller;
import eu.stork.peps.auth.engine.core.impl.SignModuleFactory;
import eu.stork.peps.configuration.ConfigurationCreator;
import eu.stork.peps.configuration.ConfigurationReader;
@@ -237,7 +240,7 @@ public class SAMLEngine {
* @return the SAML core properties
*/
protected final STORKSAMLCore getSamlCoreProperties() {
- return samlCore;
+ return samlCore;
}
/**
@@ -259,7 +262,11 @@ public class SAMLEngine {
final MarshallerFactory marshallerFactory = Configuration
.getMarshallerFactory();
- final Marshaller marshaller = marshallerFactory
+ final Marshaller marshaller;
+ if (samlToken.getElementQName().toString().endsWith(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ marshaller = new CustomAttributeQueryMarshaller();
+ else
+ marshaller = marshallerFactory
.getMarshaller(samlToken);
docBuilder = dbf.newDocumentBuilder();
@@ -326,9 +333,9 @@ public class SAMLEngine {
*/
protected final byte[] signAndMarshall(final SignableSAMLObject samlToken)
throws SAMLEngineException {
- LOG.debug("Marshall Saml Token.");
- SignableSAMLObject signElement = sign(samlToken);
- return marshall(signElement);
+ LOG.debug("Marshall Saml Token.");
+ SignableSAMLObject signElement = sign(samlToken);
+ return marshall(signElement);
}
/**
@@ -362,7 +369,11 @@ public class SAMLEngine {
final UnmarshallerFactory unmarshallerFact = Configuration.getUnmarshallerFactory();
// Unmarshall using the SAML Token root element
if (unmarshallerFact != null && root != null){
- final Unmarshaller unmarshaller = unmarshallerFact.getUnmarshaller(root);
+ final Unmarshaller unmarshaller;
+ if (root.getLocalName().equals(CustomAttributeQuery.DEFAULT_ELEMENT_LOCAL_NAME))
+ unmarshaller = new CustomAttributeQueryUnmarshaller();
+ else
+ unmarshaller = unmarshallerFact.getUnmarshaller(root);
try {
return unmarshaller.unmarshall(root);
} catch (NullPointerException e){