Hello, I am trying to deal with authorization through various services, I started with VKontakte, I went through many forums and went through almost the entire algorithm, but I had problems confirming the user's validity (the moment you need to send the user token and 2 parameters from the application). So far, I'm trying to check all this out through a browser. My actions:
1) https://oauth.vk.com/access_token?client_id=ИД_МоегоПриложения_ВК&client_secret=Секретный_Ключ_Моего_Приложения&v=5.37&grant_type=client_credentials . A normal json of this type is returned:
{"access_token":"тутДлинныйТокенМоегоПриложения","expires_in":0} 2) Without updating anything, I am authorizing a user (only in a new tab) https://oauth.vk.com/authorize?client_id=ИД_Моего_Приложения&redirect_uri=blank.html
Now the URL is returned in the browser of this type https://oauth.vk.com/blank.html#code=Тут_Токен_Авторизованного_Пользователя it is not long, here FaceBook also returns the user ID, doesn’t it (does not return the ID?)
3) Without updating anything, just by opening a new tab, I check the user's authorization in my application for such a link (all data is taken from the answers of previous links)https://api.vk.com/method/secure.checkToken?token=Из_2го_пункта_Токен_Авторизованного_Пользователя&v=5.37&client_secret=Секретный_Ключ_Приложения&access_token=Из_1го_Пункта_JSON_объекта
In response, the JSON object comes with an error about the disability of the token, as I understood the token, which was passed as the very first argument
{"error":{"error_code":15,"error_msg":"Access denied: Incorrect token invalid_token","request_params":[{"key":"oauth","value":"1"}, {"key":"method","value":"secure.checkToken"}, {"key":"token","value":"токен пользователя"},{"key":"v","value":"5.37"}, {"key":"client_secret","value":"секретный ключ моего приложения"}]}} I noticed that when updating the first 2 points, the token of the application or user is constantly changing, so I specified that I did not update anything. I check it all in the browser, but I think the effect will be similar. Please help me what am I doing wrong? I found some kind of forum, the problem was there that I had to add scoupe=offline to the link, but this did not help me.