oauth2 is broken

Kevin Rushforth kevin.rushforth at oracle.com
Thu May 23 20:24:45 UTC 2019


It runs fine for me on Windows using a local build of jfx-dev. This is 
likely the same issue as 
https://bugs.openjdk.java.net/browse/JDK-8219917 which is fixed in 
JavaFX 13 EA.

-- Kevin


On 5/23/2019 8:38 AM, Anton Tarasov wrote:
> 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.
>
>



More information about the openjfx-dev mailing list