summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-04 16:08:30 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-04 16:08:30 +0100
commit009afebd8d3b877023a0f348285e78ba28a239e7 (patch)
tree65818991dffd5c27d22edec0c80a57a8e749ead3 /pdf-over-gui/src/main/java/at
parent2e542bf894651cd02a38f28215e7a11c0c018b7a (diff)
downloadpdf-over-009afebd8d3b877023a0f348285e78ba28a239e7.tar.gz
pdf-over-009afebd8d3b877023a0f348285e78ba28a239e7.tar.bz2
pdf-over-009afebd8d3b877023a0f348285e78ba28a239e7.zip
sms tan button implemented
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java39
1 files changed, 33 insertions, 6 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
index 19def107..0835ff40 100644
--- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
+++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
@@ -15,6 +15,7 @@
*/
package at.asit.pdfover.gui.bku;
+import java.io.IOException;
import java.net.URL;
import org.apache.commons.httpclient.util.HttpURLConnection;
@@ -92,22 +93,16 @@ public class MobileBKUConnector implements BkuSlConnector {
String responseData = handler.postCredentials();
if (responseData.contains("undecided.aspx?sid=")) { //$NON-NLS-1$
-
// handle polling
- //this.state.showOpenAppMessage();
this.state.showOpenAppMessageWithSMSandCancel();
if (((ATrustStatus) this.state.getStatus()).isSmsTan()) {
- //((ATrustStatus)this.state.getStatus()).setSmsTan(false);
ATrustHandler aHandler = (ATrustHandler) handler;
String response = aHandler.postSMSRequest();
aHandler.handleCredentialsResponse(response);
- ((ATrustStatus)this.state.getStatus()).setIsAPPTan("sms"); //$NON-NLS-1$
- this.state.checkTAN();
} else {
handler.handlePolling(responseData);
}
-
} else {
@@ -220,4 +215,36 @@ public class MobileBKUConnector implements BkuSlConnector {
return signingState.getSignatureResponse();
}
+
+
+ private void handleSMSTan(MobileBKUHandler handler) throws Exception {
+
+ if (handler instanceof ATrustHandler) {
+ ((ATrustStatus)this.state.getStatus()).setSmsTan(false);
+ ATrustHandler aHandler = (ATrustHandler) handler;
+ String response = aHandler.postSMSRequest();
+ aHandler.handleCredentialsResponse(response);
+ //((ATrustStatus)this.state.getStatus()).setIsAPPTan("sms"); //$NON-NLS-1$
+ this.state.checkTAN();
+
+ // Post TAN
+ try {
+ response = aHandler.postTAN();
+ log.trace("Response from mobile BKU: " + response); //$NON-NLS-1$
+
+ // Now we have received some data lets check it:
+ aHandler.handleTANResponse(response);
+
+ } catch (Exception ex) {
+ log.error("Error in PostTanThread", ex); //$NON-NLS-1$
+ this.state.setThreadException(ex);
+ this.state.displayError(ex);
+ throw new SignatureException(ex);
+ }
+ // if everything went fine -> return
+ //return signingState.getSignatureResponse();
+ }
+ }
+
+
}