P
P
Pavel Peskov2016-07-13 08:51:26
JavaScript
Pavel Peskov, 2016-07-13 08:51:26

How to get a perpetual javascript token for vk api?

Good afternoon, VKontakte client authorization is required to receive a perpetual token. I use openapi, got the rights for offline access, saved the token in localstorage, but after a while the token expires. Tell me, is it possible to get a perpetual token for the site at all, and if so, how.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soofftt91, 2016-11-26
@soofftt91

Most likely the author is no longer relevant, but perhaps it will be useful to someone.
https://vk.com/dev/first_guide

V
Vitaly, 2016-07-13
@vshvydky

But doesn’t VK clearly indicate that the action of the token is limited by a time frame?

3. Obtaining an access_token
After successful authorization of the application, the user's browser will be redirected to the redirect_uri address specified when opening the authorization dialog. In this case, the access_token API access key and other parameters will be passed in the URL fragment of the link:
http://REDIRECT_URI#access_token=
533bacf01e11f55b536a565b57531ad114461ae8736d6506a3 &expires_in=86400&user_id=8492&state=123456 If the key has expired, then it is necessary to repeat all the steps described above, but in this case the user will no longer have to allow access twice. It is also necessary to request an access_token when the user changes their login or password or deletes the application in the access settings.
In addition, among the returned parameters, user_id will be specified - the identifier of the authorized user.
If an authorization error occurs, information about this error will be passed as GET parameters to the redirect_uri.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question