K
K
koliane2020-07-09 15:30:48
Mobile development
koliane, 2020-07-09 15:30:48

How to fix VKontakte error "User authorization failed: access_token was given to another ip address"?

I do authorization in the android and apple application through the social. Vkontakte service.

The algorithm is as follows:
1) The Apple or Android application receives an access_token from VKontakte
2) This token is transferred to the server (to register the user in the database)
3) I try to get information about the user using the token by accessing the VKontakte api, but in response I get the error "User authorization failed: access_token was given to another ip address"

From the error, it is clear that the token was requested by the client with one ip, and the server has a different ip

. Tell me, how can I overcome this error?
I try to get information about the user using the method

https: //api.vk.com/method/users.get?v=5.8&fields=uid,
first_name,
last_name,
nickname,
screen_name,
sex,
bdate,
city,
country,
timezone,
photo,
photo_medium,
photo_max_orig,
photo_rec,
email&access_token=<здесь токен, который передало приложение>


I tried various combinations with the parameters client_secret, client_id, etc., but the result is the same.
Also in Android, they tried to add the offline value to the scope (they write on the Internet that it helped some) - it didn’t work out either.

How to get user information by token by making a request from the server so that this error does not occur? What are the solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
scripter, 2020-07-09
@scripter

scope=offline, so you will get a perpetual token without IP bindings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question