From 1d17cc2cb30c5ad9f419b7d619805e3823283acc Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 31 Oct 2014 10:23:40 +0100 Subject: fix STORK DateFormat --- .../main/java/at/gv/egovernment/moa/util/DateTimeUtils.java | 1 + .../moa/id/protocols/stork2/MOAAttributeProvider.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java index dbc9faba6..a2e0965d4 100644 --- a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java +++ b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java @@ -491,6 +491,7 @@ public class DateTimeUtils { fmt = DateTimeFormat.forPattern("yyyyMMdd"); break; default: + fmt = DateTimeFormat.forPattern("yyyy-MM-dd"); break; } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java index 021eaee37..88c0e3245 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOAAttributeProvider.java @@ -36,12 +36,17 @@ import eu.stork.peps.auth.commons.STORKStatusCode; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.text.DateFormat; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; + import javassist.expr.Instanceof; /** @@ -132,9 +137,11 @@ public class MOAAttributeProvider { } private String getFormatedDateOfBirth() { - if (authData.getDateOfBirth() != null) - return authData.getFormatedDateOfBirth(); + if (authData.getDateOfBirth() != null) { + DateFormat fmt = new SimpleDateFormat("yyyyMMdd"); + return fmt.format(authData.getDateOfBirth()); + } else return null; -- cgit v1.2.3