aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-06-23 10:16:46 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-06-23 10:16:46 +0200
commitb3aa8b6d444e7dee51e1145e3192b191ae24b1d4 (patch)
treedf50afeab743422b480ac5b855b89b11cd47e6e3 /id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java
parent21dd0d9a01a77e00565af20d55b52daaf1b3af32 (diff)
downloadmoa-id-spss-b3aa8b6d444e7dee51e1145e3192b191ae24b1d4.tar.gz
moa-id-spss-b3aa8b6d444e7dee51e1145e3192b191ae24b1d4.tar.bz2
moa-id-spss-b3aa8b6d444e7dee51e1145e3192b191ae24b1d4.zip
fix some problems in eIDAS module
Diffstat (limited to 'id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java')
-rw-r--r--id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java
index 8289e18d2..2beb419fb 100644
--- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java
+++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java
@@ -49,6 +49,7 @@ 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.logging.Logger;
+import at.gv.egovernment.moa.util.MiscUtil;
import eu.eidas.auth.commons.EIDASAuthnResponse;
import eu.eidas.auth.commons.EIDASStatusCode;
import eu.eidas.auth.commons.EIDASUtil;
@@ -87,20 +88,21 @@ public class eIDASAuthenticationRequest implements IAction {
// TODO make use of proper builder
switch(current.getKey()) {
- 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;
-
- //TODO: change bPK builder !!!!!!
- case Constants.eIDAS_ATTR_PERSONALIDENTIFIER: newValue = authData.getBPK(); break;
+ 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 = authData.getBPK(); break;
+
}
- if("".equals(newValue))
+ if(MiscUtil.isEmpty(newValue))
current.getValue().setStatus(EIDASStatusCode.STATUS_NOT_AVAILABLE.toString());
+
else {
current.getValue().getValue().clear();
current.getValue().getValue().add(newValue);
current.getValue().setStatus(EIDASStatusCode.STATUS_AVAILABLE.toString());
+
}
}
@@ -138,8 +140,9 @@ public class eIDASAuthenticationRequest implements IAction {
token = EIDASUtil.encodeSAMLToken(response.getTokenSaml());
- } catch(Exception e) {
+ } catch(Exception e) {
e.printStackTrace();
+
}
revisionsLogger.logEvent(req, Constants.eIDAS_REVERSIONSLOG_IDP_AUTHREQUEST);