I am trying to implement authentication of my standalone java application at VKontakte - Russian social network.
I want to avoid requesting a password from the user, so my method is like this:
- open default browser with a special generated URL
- in the opened page user clicks Accept button
- browser gets redirected to a special URL from where I can extract access_token which is supposed to be used for any other further request.
But the problem is that I do not know how to get that new URL from the browser. The code I am using is
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.BROWSE)) {
try {
URI uri = new URI("some URL here");
desktop.browse(uri);