From 6cc72b5a50be9b1ae68d446da10f6a5f9f2ce2a2 Mon Sep 17 00:00:00 2001 From: Jakob Heher Date: Wed, 2 Nov 2022 10:35:21 +0100 Subject: adjust to webauthn lib signature changes --- .../mobilebku/MobileBKUFido2Composite.java | 21 ++++++++++----------- 1 file 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 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(); }); } -- cgit v1.2.3