Hello!

You need the following: send a request for authorization to VK. Get access_token in the HTML TELE response message. It is in the body that is important. I send a request for authorization as follows:

NetSend("http://oauth.vk.com/authorize?client_id=+++&scope=12&redirect_uri=http://oauth.vk.com/blank.html&v=5.5&response_type=token", Response); 

Where Response is OnResponse (char * response, int length) {...}.
Parameters - server response and response message length. Everything works ... The answer comes only:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1251" /> <title>OAuth Blank</title> </head> <body> Пожалуйста, <b>не копируйте</b> данные из адресной строки для сторонних сайтов. Таким образом Вы можете <b>потерять доступ</b> к Вашему аккаунту. </body> </html> 

As you can see, the token is not there, it comes to the browser line (I don’t have functions that could accept the token somehow in a special way. Trouble, I can’t log in. Okay, how I solved the problem:

https://oauth.vk.com/access_token?client_id=+++*&client_secret=+++&v=5.5&grant_type=client_credentials

I get back:

 {"access_token":"4f3d15484f3d15484f60a960734f03cb3444f3d4f3d15481c07d11a045de4505f7cf2e3","expires_in":0} 

Only this access_token does not work, why ???

  • Perhaps of course. How does the application work? Tell the steps. Who goes where that does. See the redirect_url parameter in the authorization of Standalone applications . Redirect the user to a page on your site (his domain must be registered in the application settings), and there first give your page with JS, which will take the token from the address bar, and then AJAX will post it right there to the script on your site, where you save it. - Sergiks
  • It should work like this: 1) There is a mobile device and only it, on it the button "Place someone's post on your page" 2) When you click on the button, you need to place someone (it is blocked in the program) post on page vk. How it should look like: clicked on the button, the vk window came out, the user entered his data into it, a process came to the token in the html body of the response from the server, the application processed this html, removed the token and repostnula on the phone’s owner’s page. - Alerr
  • Here it works: api.vk.com/method/execute.POST?1&access_token=++++ // oauth.vk.com/..BUT , the current is not in the body of HTML !!! How to ask the server to put the token in the HTML response ????? - Alerr
  • What for do you need it? JSON is much easier to parse than bite out HTML data. - VladD
  • Yes, I have a huge problem, there is only a method that accepts html answers, there is nothing more. Is this possible ???? - Alerr

0