Good day
I want to get access to the VK Api methods. Please explain why:
- The documentation states that the "code" parameter must be specified in the responseType method in order to further obtain an access token. But I can get it by writing responseType ("token"), why this "code"?
For some reason, the "code", which is given in the documentation, is different from mine, as if part of my "code" is cut off.
public static void main(String... args) { final String clientId = "5811559"; // ID ΠΌΠΎΠ΅Π³ΠΎ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ Vk final String clientSecret = "ZOAAWpmdT6h4AGkSGGYV"; //Π‘Π΅ΠΊΡΠ΅ΡΠ½ΡΠΉ ΠΊΠ»ΡΡ final OAuth20Service service = new ServiceBuilder() .apiKey(clientId) .apiSecret(clientSecret) .callback("https://oauth.vk.com/blank.html ") .scope("friends") .responseType("code") .build(VkontakteApi.instance()); }
It should turn out something like this:
REDIRECT_URI?code=7a6fa4dff77a228eeda56603b8f53806c883f011c40b72630bb50df056f6479e52a And it turns out:
https://oauth.vk.com/blank.html#code=6b42804b417113a2af