Answer the question
In order to leave comments, you need to log in
How to log in correctly through VKApiClient?
I can't figure out how to properly authorize via VKApi in the desktop application.
The documentation says -
TransportClient transportClient = HttpTransportClient.getInstance();
VkApiClient vk = new VkApiClient(transportClient);
UserAuthResponse authResponse = vk.oauth()
.userAuthorizationCodeFlow(APP_ID, CLIENT_SECRET, REDIRECT_URI, code)
.execute();
UserActor actor = new UserActor(authResponse.getUserId(), authResponse.getAccessToken());
GetResponse getResponse = vk.wall().get(actor)
.ownerId(1)
.count(100)
.offset(5)
.filter("owner")
.execute();
Answer the question
In order to leave comments, you need to log in
Values of the "Application ID" fields (in the documentation, it corresponds to the API_ID, app_id or client_id parameter) and "Secured key" (secret_key, client_secret).
Authorization methods:
OAuth authorization:
Client or server authorization based on the OAuth 2.0 protocol
Direct authorization:
For trusted applications, an alternative method is possible - direct authorization by user login
and password.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question