diff options
Diffstat (limited to 'id.server/src/at')
-rw-r--r-- | id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java index 27d91bf1f..74e31e45e 100644 --- a/id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java +++ b/id.server/src/at/gv/egovernment/moa/id/auth/data/AuthenticationSession.java @@ -2,6 +2,8 @@ package at.gv.egovernment.moa.id.auth.data; import java.util.Date; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Constants; /** * Session data to be stored between <code>AuthenticationServer</code> API calls. @@ -61,6 +63,8 @@ public class AuthenticationSession { */ private boolean businessService; + private static String TARGET_PREFIX_ = Constants.URN_PREFIX_CDID + "+"; + /** * Constructor for AuthenticationSession. * @@ -160,11 +164,20 @@ public class AuthenticationSession { } /** - * Sets the target. + * Sets the target. If the target includes the target prefix, the prefix will be stripped off. * @param target The target to set */ public void setTarget(String target) { - this.target = target; + if (target != null && target.startsWith(TARGET_PREFIX_)) + { + // If target starts with prefix "urn:publicid:gv.at:cdid+"; remove prefix + this.target = target.substring(TARGET_PREFIX_.length()); + Logger.debug("Target prefix stripped off; resulting target: " + this.target); + } + else + { + this.target = target; + } } /** |