Answer the question
In order to leave comments, you need to log in
Java-Oauth2-vk. How to get a token after a redirect for a desktop app?
Hello everyone :)
As a matter of fact, I want to authorize a desktop application in VK. The problem is that I'm confused and can't figure out how to automate the receipt of a token in the application itself. In the VK API, after confirming the user, it will redirect us to " https://oauth.vk.com/blank.html " how can I get a token from there ???
Options that I found:
1) There was an option to create a local server using springboot and write a redirect there, but when registering a standalone application " https://oauth.vk.com/blank.html " this link cannot be changed .... That is this option is not suitable?
2) You can try to file something like your browser and for the user to log in there and then there won’t seem to be any problems ... But this is a lot of problems ...
In general, it seems to me that I missed something and there should be some an easy way to do this.
At the moment, I can send the user to log in to the default browser, but I have no idea how to get this token from there after the redirect. Do not force the user to copy the token manually and give it to me in the application :)) I will be glad for any hint :))
Answer the question
In order to leave comments, you need to log in
Either ask the user to insert a link with a token into a certain field in the program, or run the application client on javaFx and use WebView (the built-in browser is no worse than the others, except that it can eat memory immeasurably if you climb through it. it seems that there is a memory leak, etc. c. gc is in no hurry to release the used resources, but it will not fly away in outofmemoryerror either)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question