summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
diff options
context:
space:
mode:
authorJakob Heher <jakob.heher@iaik.tugraz.at>2022-10-05 12:27:07 +0200
committerJakob Heher <jakob.heher@iaik.tugraz.at>2022-10-05 12:27:07 +0200
commit8d7000e17c41b5a09590202e7ce644c9b86bfe11 (patch)
tree7bcda2e8af913d9777a7314ed25f1dcd4ce7260b /pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java
parent4269338d2e11028a880c99eb906c93a397fd0c1f (diff)
downloadpdf-over-8d7000e17c41b5a09590202e7ce644c9b86bfe11.tar.gz
pdf-over-8d7000e17c41b5a09590202e7ce644c9b86bfe11.tar.bz2
pdf-over-8d7000e17c41b5a09590202e7ce644c9b86bfe11.zip
smstan support
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java15
1 files changed, 13 insertions, 2 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 1c07376c..dc2258a1 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
@@ -250,7 +250,7 @@ public class MobileBKUConnector implements BkuSlConnector {
if (html.usernamePasswordBlock != null) {
try {
while ((this.credentials.username == null) || (this.credentials.password == null)) {
- this.state.getCredentialsFromUserTo(this.credentials, null); // TODO error message
+ this.state.getCredentialsFromUserTo(this.credentials, html.usernamePasswordBlock.errorMessage);
}
html.usernamePasswordBlock.setUsernamePassword(this.credentials.username, this.credentials.password);
return buildFormSubmit(html, "#Button_Identification");
@@ -258,6 +258,17 @@ public class MobileBKUConnector implements BkuSlConnector {
return buildFormSubmit(html, "#Button_Cancel");
}
}
+ if (html.smsTanBlock != null) {
+ MobileBKUState.SMSTanResult result = this.state.getSMSTanFromUser(
+ html.smsTanBlock.referenceValue, html.smsTanBlock.triesRemaining,
+ html.signatureDataLink, html.fido2Link != null, html.smsTanBlock.errorMessage);
+
+ switch (result.type) {
+ case TO_FIDO2: if (html.fido2Link != null) return new HttpGet(html.fido2Link);
+ case SMSTAN: html.smsTanBlock.setTAN(result.smsTan); return buildFormSubmit(html, "#SignButton");
+ }
+ return new HttpGet(html.htmlDocument.baseUri());
+ }
if (html.qrCodeBlock != null) {
try (final CloseableHttpClient httpClient = HttpClients.custom().disableRedirectHandling().build()) {
final HttpGet request = new HttpGet(html.qrCodeBlock.pollingURI);
@@ -297,7 +308,7 @@ public class MobileBKUConnector implements BkuSlConnector {
});
try {
longPollThread.start();
- MobileBKUState.QRResult result = this.state.showQRCode(html.qrCodeBlock.referenceValue, html.qrCodeBlock.qrCodeURI, html.signatureDataLink, html.smsTanLink != null, html.fido2Link != null, null);
+ MobileBKUState.QRResult result = this.state.showQRCode(html.qrCodeBlock.referenceValue, html.qrCodeBlock.qrCodeURI, html.signatureDataLink, html.smsTanLink != null, html.fido2Link != null, html.qrCodeBlock.errorMessage);
switch (result) {
case UPDATE: break;
case TO_FIDO2: if (html.fido2Link != null) return new HttpGet(html.fido2Link); break;