aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-08-02 14:48:56 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-08-02 14:48:56 +0200
commita9b9c5177217de2f99298a416a25f912944d6383 (patch)
tree6556dec0479e3eb21b23eebb3b06a704c4bd4162 /id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
parentd63a3e5b0ae43808cddd89d62f57868278eb50eb (diff)
downloadmoa-id-spss-a9b9c5177217de2f99298a416a25f912944d6383.tar.gz
moa-id-spss-a9b9c5177217de2f99298a416a25f912944d6383.tar.bz2
moa-id-spss-a9b9c5177217de2f99298a416a25f912944d6383.zip
First untested version of refactor eIDAS module, which uses eIDAS SAMLEngine v1.1 from JoinUp
Diffstat (limited to 'id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java')
-rw-r--r--id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java77
1 files changed, 37 insertions, 40 deletions
diff --git a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
index 113fb943f..0a760cb5a 100644
--- a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
+++ b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
@@ -25,7 +25,6 @@ package at.gv.egovernment.moa.id.protocols.saml1;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;
-import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -37,7 +36,6 @@ import javax.xml.namespace.QName;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
-import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.w3c.dom.Element;
@@ -52,7 +50,6 @@ import at.gv.egovernment.moa.id.auth.builder.PersonDataBuilder;
import at.gv.egovernment.moa.id.auth.builder.SAMLArtifactBuilder;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute;
-import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttributeImpl;
import at.gv.egovernment.moa.id.auth.exception.AuthenticationException;
import at.gv.egovernment.moa.id.auth.exception.BuildException;
import at.gv.egovernment.moa.id.auth.exception.ParseException;
@@ -82,8 +79,6 @@ import at.gv.util.xsd.persondata.IdentificationType.Value;
import at.gv.util.xsd.persondata.PersonNameType;
import at.gv.util.xsd.persondata.PersonNameType.FamilyName;
import at.gv.util.xsd.persondata.PhysicalPersonType;
-import eu.eidas.auth.commons.IPersonalAttributeList;
-import eu.eidas.auth.commons.PersonalAttribute;
//import at.gv.egovernment.moa.id.util.IdentityLinkReSigner;
@Service("SAML1AuthenticationServer")
@@ -127,41 +122,43 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
return error;
}
- /**
- * Transforms additional STORK attributes to MOA Extended attributes
- * @param iPersonalAttributeList STORK attribute list
- * @return
- */
- public List<ExtendedSAMLAttribute> addAdditionalSTORKAttributes(IPersonalAttributeList iPersonalAttributeList) {
- List<ExtendedSAMLAttribute> moaExtendedSAMLAttributeList = new Vector<ExtendedSAMLAttribute>();
-
- if(null == iPersonalAttributeList)
- return moaExtendedSAMLAttributeList;
-
- Logger.trace("Adding the following attributes to MOA assertion: ");
- int count = 0;
-
- for (PersonalAttribute attribute : iPersonalAttributeList) {
- Object attributeValue = attribute.getValue();
- if (null == attributeValue)
- attributeValue = attribute.getComplexValue();
-
- // escape attributeValue
- attributeValue = StringEscapeUtils.escapeXml10(attributeValue.toString());
- // and remove trailing and tailing brackets. Might break something but we never saw an array with more than one entry!
- attributeValue = ((String) attributeValue).substring(1, ((String) attributeValue).length() - 1);
-
- ExtendedSAMLAttribute extendedSAMLAttribute =
- new ExtendedSAMLAttributeImpl(attribute.getName(), attributeValue, Constants.STORK_NS_URI, 0);
- moaExtendedSAMLAttributeList.add(extendedSAMLAttribute);
- count++;
- Logger.trace("Additional attribute: " + attribute.getName());
- }
-
- Logger.debug("Added " + count + " STORK attribute(s) to the MOA assertion.");
-
- return moaExtendedSAMLAttributeList;
- }
+
+ //TODO: add eIDAS to SAML1 protocol if it is really necessary
+// /**
+// * Transforms additional STORK attributes to MOA Extended attributes
+// * @param iPersonalAttributeList STORK attribute list
+// * @return
+// */
+// public List<ExtendedSAMLAttribute> addAdditionalSTORKAttributes(IPersonalAttributeList iPersonalAttributeList) {
+// List<ExtendedSAMLAttribute> moaExtendedSAMLAttributeList = new Vector<ExtendedSAMLAttribute>();
+//
+// if(null == iPersonalAttributeList)
+// return moaExtendedSAMLAttributeList;
+//
+// Logger.trace("Adding the following attributes to MOA assertion: ");
+// int count = 0;
+//
+// for (PersonalAttribute attribute : iPersonalAttributeList) {
+// Object attributeValue = attribute.getValue();
+// if (null == attributeValue)
+// attributeValue = attribute.getComplexValue();
+//
+// // escape attributeValue
+// attributeValue = StringEscapeUtils.escapeXml10(attributeValue.toString());
+// // and remove trailing and tailing brackets. Might break something but we never saw an array with more than one entry!
+// attributeValue = ((String) attributeValue).substring(1, ((String) attributeValue).length() - 1);
+//
+// ExtendedSAMLAttribute extendedSAMLAttribute =
+// new ExtendedSAMLAttributeImpl(attribute.getName(), attributeValue, Constants.STORK_NS_URI, 0);
+// moaExtendedSAMLAttributeList.add(extendedSAMLAttribute);
+// count++;
+// Logger.trace("Additional attribute: " + attribute.getName());
+// }
+//
+// Logger.debug("Added " + count + " STORK attribute(s) to the MOA assertion.");
+//
+// return moaExtendedSAMLAttributeList;
+// }
/**