Reputation: 337
I was able to successfully implement google drive api example in java as described here enter link description here . But here the client/user needs to explicitly copy and paste the oauth 2 authorization code from web browser to the desktop application manually (which is not a good user experience).I don't know how to tackle this i.e. to automate this process using java code.
Upvotes: 1
Views: 2148
Reputation: 932
There is no ideal solution in this case, but here are a couple of workable solutions: - the desktop app can run an embedded web server, use a localhost redirect, on Windows you may have issues with the firewall by default blocking access to localhost, not sure - use a custom scheme, the scheme can be registered by the desktop app during registration - the code is part of the page title and this title shows up in the OS controlled window title, your app could launch an external browser and then track the process and its main window
Upvotes: 1