I write a small PHP script, post a message to the group / discussion. The problem is this: after logging in via oauth, it gives a token with a redirect to http://oauth.vk.com/blank.html , so I pull it out with my hands (can I pull it out somehow with my hands?). I pulled it out, in the parameters indicated scope=offline , but at the same time the token is reset after the first command is executed, and it cannot be used a second time. What am I doing wrong?

  $params = array( 'client_id' => $client_id, 'redirect_uri' => 'http://oauth.vk.com/blank.html', 'response_type' => 'code', 'scope' => 'notify,friends,photos,audio,video,docs,notes,status,offers,questions,wall,groups,messages,notifications,stats,ads,offline' ); http://oauth.vk.com/authorize?'. urldecode(http_build_query($params)) 
  • What vk.com/blank.html? In redirect_uri you need to specify your URL. And there already code comes as $_GET['code'] . And after getting access_token by this code, check the expires_in parameter. - user6550
  • redirect_uri = oauth.vk.com/blank.html This is a prerequisite for working with methods whose description indicates that they are available only for Desktop applications. - avengerweb
  • However, the documentation ("Authorization of client applications") says a little more. - user6550
  • This is a quote from there. - avengerweb
  • And read on and try to understand the meaning of reditect_uri? - user6550