Skip to content

[BUG] Error from loginWithAsyncWebview. #41

Description

@gab4000

Bug

loginWithAsyncWebview return an error
I think that the problem comes from my Java version but I can't do otherwise.

Config

  • OS: macOS Catalina 10.15.7
  • Java version: Amazon corretto 1.8.0_312

Full error

Exception in thread "JavaFX Application Thread" java.lang.UnsatisfiedLinkError: Can't load library: /Users/$USER/Library/Java/JavaVirtualMachines/corretto-1.8.0_312/Contents/Home/jre/lib/libjfxwebkit.dylib
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1820)
	at java.lang.Runtime.load0(Runtime.java:810)
	at java.lang.System.load(System.java:1088)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
	at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
	at com.sun.webkit.WebPage.lambda$static$0(WebPage.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.webkit.WebPage.<clinit>(WebPage.java:132)
	at javafx.scene.web.WebEngine.<init>(WebEngine.java:881)
	at javafx.scene.web.WebEngine.<init>(WebEngine.java:868)
	at javafx.scene.web.WebView.<init>(WebView.java:273)
	at fr.litarvan.openauth.microsoft.LoginFrame.init(LoginFrame.java:76)
	at fr.litarvan.openauth.microsoft.LoginFrame.lambda$start$0(LoginFrame.java:66)
	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

Source code

private void authenticateMS() {

        MicrosoftAuthenticator authenticator = new MicrosoftAuthenticator();
        authenticator.loginWithAsyncWebview().whenComplete((response, error) -> {

            if (error != null) {
                logger.err(error.getMessage());
                return;
            }

            saver.set("msAccessToken", response.getAccessToken());
            saver.set("msRefreshToken", response.getRefreshToken());
            saver.save();

            ModMCore.getInstance().setAuthInfos(new AuthInfos(response.getProfile().getName(), response.getAccessToken(), response.getProfile().getId()));
            this.logger.info("Bienvenue " + response.getProfile().getName());

            Platform.runLater(() -> panelManager.showPanel(new App()));
        });
    }

Ask me for more source code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions