summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_auth_sl20/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_modules/eaaf_module_auth_sl20/src/main')
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java28
-rw-r--r--eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20Constants.java4
2 files changed, 31 insertions, 1 deletions
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java
index 6a5e1ef0..6c11fa63 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/tasks/AbstractCreateQualEidRequestTask.java
@@ -105,6 +105,18 @@ public abstract class AbstractCreateQualEidRequestTask extends AbstractAuthServl
parameters.add(new BasicNameValuePair(SL20Constants.PARAM_SL20_REQ_AUTH_METHOD_PARAM,
authMethod.getAuthMethod()));
}
+
+ //set VDA sessionId if it was available on context
+ String vdaSessionId = getVdaSessionIdFromContext(executionContext);
+ if (vdaSessionId != null) {
+ log.trace("Request VDA with sessionId: {}", vdaSessionId);
+ parameters.add(new BasicNameValuePair(
+ SL20Constants.PARAM_SL20_REQ_AUTH_VDA_SESSIONID,
+ vdaSessionId));
+
+ }
+
+
httpReq.setEntity(new UrlEncodedFormEntity(parameters));
@@ -231,6 +243,22 @@ public abstract class AbstractCreateQualEidRequestTask extends AbstractAuthServl
return null;
}
+ private String getVdaSessionIdFromContext(ExecutionContext executionContext) {
+ Serializable vdaSessionId = executionContext.get(
+ SL20Constants.SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERROR_VDASESSIONID);
+ if (vdaSessionId instanceof String
+ && StringUtils.isNotEmpty((CharSequence) vdaSessionId)) {
+ executionContext.remove(
+ SL20Constants.SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERROR_VDASESSIONID);
+
+ log.trace("Find vdaSessionId parameter: {} on context", vdaSessionId);
+ return (String) vdaSessionId;
+
+ }
+
+ return null;
+ }
+
private String extractVdaUrlForSpecificOa(final ISpConfiguration oaConfig, final ExecutionContext executionContext) {
// load SP specific config for development and testing purposes
diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20Constants.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20Constants.java
index 8c520931..6c3c7545 100644
--- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20Constants.java
+++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20Constants.java
@@ -19,6 +19,7 @@ public class SL20Constants {
public static final String PARAM_SL20_REQ_COMMAND_PARAM_OLD = "sl2command";
public static final String PARAM_SL20_REQ_AUTH_METHOD_PARAM = "authtype";
+ public static final String PARAM_SL20_REQ_AUTH_VDA_SESSIONID = "handySignaturSession";
public enum VdaAuthMethod {
ANY("any"), MOBILEPHONE("handy"), CARD("card"), SMARTPHONE("smartphone");
@@ -176,7 +177,8 @@ public class SL20Constants {
// error command
public static final String SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERRORCODE = "errorCode";
public static final String SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERRORMESSAGE = "errorMessage";
- public static final String SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERROR_VDASESSIONID = "handySignaturSession";
+ public static final String SL20_COMMAND_PARAM_GENERAL_RESPONSE_ERROR_VDASESSIONID
+ = PARAM_SL20_REQ_AUTH_VDA_SESSIONID;
// qualified eID command
@Deprecated