E
E
elisey4742015-11-19 19:49:37
PHP
elisey474, 2015-11-19 19:49:37

How to "catch" access token vk api via php?

There is a standalone VK application. I created a php script on the server, when I click on the button, it redirects me to the VK api page and access token is visible in the address bar of the browser. How to catch it? Now I just copy it with the mouse, but can I somehow write it through php, for example, immediately into a text file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
�
âš¡ Kotobotov âš¡, 2015-11-20
@angrySCV

for standalone applications, the redirect parameter is not always available (limited only for certain types of permissions, such as posting on the wall),
but in general, you can use the redirect parameter when requesting a token, which tells which address to send the generated token to.
and yes, php will still not see it at the forwarded address, because the hashtag will be used in the link, after which the data is not sent to the server, in order to receive this data, you must use JS on the browser side, which will eventually send you this token)

A
Andrew, 2015-11-19
@R0dger

I remember that in no way .. it is located where php does not see the line ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question