Hello,

We've faced a problem with broken OAuth 2.0 in WebView. Started to appear since at least 8u202 (worked in 8u152) and is still broken in JavaFX 12.

Simple reproducer is below. It should display a login page but displays nothing instead:

public class Main extends Application {
    @Override
    public void start(Stage primaryStage) {
        WebView view = new WebView();
view.getEngine().load("https://login.microsoftonline.com/common/oauth2/authorize?resource=foo&client_id=bar&response_type=code&redirect_uri=https%3A//localhost";);
        primaryStage.setScene(new Scene(view, 800, 600));
        primaryStage.show();
    }
    public static void main(String[] args) {
        launch(args);
    }
}

The problem originally came from MS User Agent lib (https://github.com/microsoft/oauth2-useragent) which uses JFX WebView to implement OAuth. The code below also shows nothing:

import com.microsoft.alm.auth.oauth.OAuth2Authenticator;

public class Main {
    public static void main(String[] args) {
        OAuth2Authenticator build = new OAuth2Authenticator.OAuth2AuthenticatorBuilder()
                .withClientId("bar")
.manage(OAuth2Authenticator.MANAGEMENT_CORE_RESOURCE)
                .redirectTo("http://localhost";)
                .build();
        build.getOAuth2TokenPair();
    }
}

Can you please comment, is it a known issue? Are there any solutions?

With regards,
Anton.


Reply via email to