R
R
rubbashka2015-02-02 00:27:29
Java
rubbashka, 2015-02-02 00:27:29

How to implement getting accesss_token in desktop application?

I dealt with the VK API, solved a lot of problems myself, and in the end I came to the question that was already asked, but there was no answer to it. How to make authorization for Java standalone application through Vkontakte? . I looked at more questions from this user, but did not understand if he coped with the problem, and if so, how?
Explain, please.
We can pass the request to the browser via java.awt.Desktop, how can we then pull the access_token from the browser? If not, then:
How to use WebView, how then to pull out this token from WebView?
Well, or the most common question: How to implement getting an access_token in a desktop application?
Where to look, direct me deeper)))

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DR_Demons, 2015-02-02
@DR_Demons

Are you doing this using the standard library? Are you able to log in when you manually transfer the token to the application?

E
Eugene, 2015-02-02
@zolt85

I myself have not tried to work with the VK API, but most often in other applications it works like this:
- the user is prompted to click on the button, which will open the browser with the application authorization page (well, this is where they say you trust the application "such a" access to your data)
- the user agrees, for example, and VKontakte redirects him to a URL with a token
- the user is prompted to copy this URL and paste it into the input in the program
. And this is where you come into play. Those. we just take and parse what the user has inserted.
In my opinion, nowhere is easier) go for it)

N
Nikolai Pavlov, 2015-02-02
@gurinderu

It can be implemented without the user tapping on the screen.
To do this, you need to see what kind of requests are sent and received when you click on the authorization button and then on the button for obtaining rights.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question