NativeWebBrowser nativeWebBrowser = (NativeWebBrowser)getNativeComponent();
JWebBrowser webBrowser = nativeWebBrowser == null? null: nativeWebBrowser.webBrowser.get();
if(webBrowser == null) {
return null;
}
WebBrowserAuthenticationHandler authenticationHandler = nativeWebBrowser.getAuthenticationHandler();
if(authenticationHandler == null) {
return new Object[] {true, null, null};
}
String resourceLocation = (String)args[0];
Credentials credentials = authenticationHandler.getCredentials(webBrowser, resourceLocation);
if(credentials == null) {
return new Object[] {false, null, null};
}
return new Object[] {true, credentials.getUserName(), credentials.getPassword()};
}