diff options
author | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-02 10:35:21 +0100 |
---|---|---|
committer | Jakob Heher <jakob.heher@iaik.tugraz.at> | 2022-11-02 10:35:21 +0100 |
commit | 6cc72b5a50be9b1ae68d446da10f6a5f9f2ce2a2 (patch) | |
tree | 9f4a001485564848d8f9907844fede5472beb064 | |
parent | 6d0be37eca3374985143292a552825aed2bbe818 (diff) | |
download | pdf-over-6cc72b5a50be9b1ae68d446da10f6a5f9f2ce2a2.tar.gz pdf-over-6cc72b5a50be9b1ae68d446da10f6a5f9f2ce2a2.tar.bz2 pdf-over-6cc72b5a50be9b1ae68d446da10f6a5f9f2ce2a2.zip |
adjust to webauthn lib signature changes
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java index 6a824345..826eed95 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/mobilebku/MobileBKUFido2Composite.java @@ -82,21 +82,20 @@ public class MobileBKUFido2Composite extends StateComposite { SWTUtils.addSelectionListener(btn_authenticate, () -> { SWTUtils.setLocalizedText(btn_authenticate, "common.working"); btn_authenticate.setEnabled(false); - PublicKeyCredentialRequestOptions.FromJSONString(this.fido2OptionsString).asyncGet("https://service.a-trust.at") - .thenAccept((PublicKeyCredential<AuthenticatorAssertionResponse> result) -> { - this.credential = result; - }).exceptionally((Throwable e) -> { - if (e instanceof WebAuthNUserCancelled) { + new Thread(() -> { + try { + this.credential = PublicKeyCredentialRequestOptions.FromJSONString(this.fido2OptionsString).get("https://service.a-trust.at"); + } catch (Throwable t) { + if (t instanceof WebAuthNUserCancelled) { this.userCancel = true; } else { - log.error("webauthn fail", e); + log.warn("webauthn operation failed", t); } - return null; - }).thenRun(() -> { - btn_authenticate.setEnabled(true); - reloadResources(); + } finally { + this.getDisplay().syncExec(() -> { btn_authenticate.setEnabled(true); this.reloadResources(); }); this.getDisplay().wake(); - }); + } + }).start(); }); } |