aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2016-01-15 15:43:54 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2016-01-15 15:43:54 +0100
commit1672ef1dc32bf37c966660c33e422729addd5b41 (patch)
tree5f9b09d3673741162e5ab99749be30e6d834b5ec /id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols
parenta8a923ddda874437efb87c9fdecfb65dd722fed0 (diff)
downloadmoa-id-spss-1672ef1dc32bf37c966660c33e422729addd5b41.tar.gz
moa-id-spss-1672ef1dc32bf37c966660c33e422729addd5b41.tar.bz2
moa-id-spss-1672ef1dc32bf37c966660c33e422729addd5b41.zip
cleanup
Diffstat (limited to 'id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols')
-rw-r--r--id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java
index 6adefdb86..1012be1b7 100644
--- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java
+++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/AuthenticationRequest.java
@@ -24,22 +24,21 @@ package at.gv.egovernment.moa.id.protocols.eidas;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
import java.util.Map.Entry;
-import iaik.pkcs.pkcs11.objects.Object;
import at.gv.egovernment.moa.id.auth.builder.BPKBuilder;
import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.auth.modules.eidas.Constants;
import at.gv.egovernment.moa.id.auth.modules.eidas.engine.MOAeIDASChainingMetadataProvider;
import at.gv.egovernment.moa.id.auth.modules.eidas.engine.MOAeIDASMetadataProviderDecorator;
import at.gv.egovernment.moa.id.auth.modules.eidas.utils.MOAPersonalAttributeList;
import at.gv.egovernment.moa.id.auth.modules.eidas.utils.SAMLEngineUtils;
+import at.gv.egovernment.moa.id.config.auth.AuthConfiguration;
+import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory;
import at.gv.egovernment.moa.id.data.IAuthData;
import at.gv.egovernment.moa.id.data.SLOInformationInterface;
import at.gv.egovernment.moa.id.moduls.IAction;
import at.gv.egovernment.moa.id.moduls.IRequest;
-import at.gv.egovernment.moa.id.protocols.pvp2x.utils.SAML2Utils;
import at.gv.egovernment.moa.id.util.VelocityProvider;
import at.gv.egovernment.moa.logging.Logger;
@@ -49,17 +48,12 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
-import org.springframework.format.datetime.DateFormatter;
-
import eu.eidas.auth.commons.EIDASAuthnResponse;
import eu.eidas.auth.commons.EIDASStatusCode;
import eu.eidas.auth.commons.EIDASUtil;
import eu.eidas.auth.commons.PersonalAttribute;
import eu.eidas.auth.engine.EIDASSAMLEngine;
-import eu.eidas.auth.engine.core.eidas.EidasAttributesTypes;
-import eu.eidas.auth.engine.core.eidas.EidasConstants;
import eu.eidas.auth.engine.metadata.MetadataUtil;
-import eu.stork.peps.auth.commons.PEPSUtil;
/**
@@ -86,11 +80,12 @@ public class AuthenticationRequest implements IAction {
for(Entry<String, PersonalAttribute> current : resultingAttributeList.entrySet()) {
String newValue = "";
+ // TODO make use of proper builder
switch(current.getKey()) {
- case "DateOfBirth": newValue = new SimpleDateFormat("YYYY-MM-dd").format(authData.getDateOfBirth()); break;
- case "CurrentFamilyName": newValue = authData.getFamilyName();break;
- case "CurrentGivenName": newValue = authData.getGivenName();break;
- case "PersonIdentifier": newValue = new BPKBuilder().buildStorkeIdentifier(authData.getIdentificationType(), authData.getIdentificationValue(),
+ case Constants.eIDAS_ATTR_DATEOFBIRTH: newValue = new SimpleDateFormat("YYYY-MM-dd").format(authData.getDateOfBirth()); break;
+ case Constants.eIDAS_ATTR_CURRENTFAMILYNAME: newValue = authData.getFamilyName();break;
+ case Constants.eIDAS_ATTR_CURRENTGIVENNAME: newValue = authData.getGivenName();break;
+ case Constants.eIDAS_ATTR_PERSONALIDENTIFIER: newValue = new BPKBuilder().buildStorkeIdentifier(authData.getIdentificationType(), authData.getIdentificationValue(),
eidasRequest.getTarget()); break;
}
@@ -106,7 +101,13 @@ public class AuthenticationRequest implements IAction {
// construct eIDaS response
EIDASAuthnResponse response = new EIDASAuthnResponse();
response.setPersonalAttributeList(resultingAttributeList);
- response.setIssuer("http://localhost:12344/moa-id-auth/eidas/metadata");
+
+ // - create metadata url
+ AuthConfiguration config = AuthConfigurationProviderFactory.getInstance();
+ String pubURLPrefix = config.getPublicURLPrefix();
+ String metadata_url = pubURLPrefix + Constants.eIDAS_HTTP_ENDPOINT_METADATA;
+ response.setIssuer(metadata_url);
+
response.setAssuranceLevel(authData.getEIDASQAALevel());
String token = null;