we're writing an open-source jdbc driver for bigquery, and ran into the following problem:
We want to authorize our driver with Oauth 2 as an installed application. On windows xp, windows 7 x64, windows 7 x64 + RDP it works fine. But on the testbench which is a windows server 2008 R2 + RDP it fails.
Basically, we open a web browser, he logs in, we catch the reply, and authenticate the user.
Here's the code for the url opening:
private static void browse(String url) {
// first try the Java Desktop
logger.debug("First try the Java Desktop");
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Action.BROWSE))
try {
desktop.browse(URI.create(url));
return;
} catch (IOException e) {
// handled below
}
}
// Next try rundll32 (only works on Windows)
logger.debug("Try the rundll32");
try {
Runtime.getRuntime().exec(
"rundll32 url.dll,FileProtocolHandler " + url);
return;
} catch (IOException e) {
// handled below
}
// Next try browsers
logger.debug("Try with browsers");
BareBonesBrowserLaunch.openURL(url);
}
What i figured out is: BareBonesBrowserLaunch doesn't open the link, nor does the FileProtocolHandler.
The URL lenght is a little bit under 250character.
Any assistance would be appreciated!