Answer the question
In order to leave comments, you need to log in
Is it possible to pass authorization with getting code through Java SDK?
Good afternoon!
I wanted to try the VK API through the JAVA SDK. According to the VK manuals, I first tried to get the code and token in the browser - everything worked out. But I wanted to make some kind of my own client application, for now without specific goals, it is possible to keep statistics of which of my friends is online for how long, etc. just for study. And then immediately the problem: I can not pass authorization without specifying the token. Although the essence is just that the token is formed as a result of the request
https://oauth.vk.com/authorize?client_id=1&display=page&redirect_uri=http://example.com/callback&scope=friends&response_type=code&v=5.131
- VK example. Using such a not tricky code, I get a message that I am not authorized, therefore no code is generated.URL redir_url = new URL(OAUTH_URI);
HttpURLConnection con = (HttpURLConnection) redir_url.openConnection();
int responsecode = con.getResponseCode();
String answer = con.getResponseMessage();
System.out.println("resp: " + responsecode + " answer: " + answer);
https://oauth.vk.com/blank.html
, then in the console we get a response and information about this page without any problems. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question