diff options
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java | 8 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java index 75f02dd6..96530cf0 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/mobile/ATrustHandler.java @@ -231,6 +231,7 @@ public class ATrustHandler extends MobileBKUHandler { if (responseData.contains("signature.aspx?sid=")) {
// credentials ok! TAN entry
+ state.rememberCredentialsIfNecessary();
log.debug("Credentials accepted - TAN required");
sessionID = MobileBKUHelper.extractSubstring(responseData, "signature.aspx?sid=", "\"");
viewState = MobileBKUHelper.extractValueFromTagWithParam(responseData, "", "id", "__VIEWSTATE", "value");
@@ -264,6 +265,7 @@ public class ATrustHandler extends MobileBKUHandler { } else if (responseData.contains("sl:InfoboxReadResponse")) {
// credentials ok! InfoboxReadResponse
+ state.rememberCredentialsIfNecessary();
log.debug("Credentials accepted - Response given");
getSigningState().setSignatureResponse(new SLResponse(responseData, getStatus().server, null, null));
return;
@@ -275,6 +277,9 @@ public class ATrustHandler extends MobileBKUHandler { return;
}else {
// error page
+
+ // force UI again!
+ state.clearRememberedCredentials();
// extract error text!
try {
String errorMessage = MobileBKUHelper.extractContentFromTagWithParam(responseData, "span", "class", "ErrorClass");
@@ -283,9 +288,6 @@ public class ATrustHandler extends MobileBKUHandler { throw new SignatureException(MobileBKUHelper.extractSubstring(responseData, "<sl:ErrorCode>", "</sl:ErrorCode>") + ": " +
MobileBKUHelper.extractSubstring(responseData, "<sl:Info>", "</sl:Info>"));
}
-
- // force UI again!
- status.mobilePassword = null;
}
log.debug("sessionID: " + sessionID);
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java index d5f5cbe0..020ead33 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/MobileBKUState.java @@ -186,6 +186,19 @@ public class MobileBKUState extends State { });
}
+ public void rememberCredentialsIfNecessary() {
+ if (getStateMachine().configProvider.getRememberMobilePassword())
+ {
+ getStateMachine().configProvider.setDefaultMobileNumberOverlay(status.phoneNumber);
+ getStateMachine().configProvider.setDefaultMobilePasswordOverlay(status.mobilePassword);
+ }
+ }
+
+ public void clearRememberedCredentials() {
+ getStateMachine().configProvider.setDefaultMobilePasswordOverlay(null);
+ status.mobilePassword = null;
+ }
+
/**
* Make sure phone number and password are set in the MobileBKUStatus
*/
|