Answer the question
In order to leave comments, you need to log in
Authorization in Vkontakte in NodeJs app on Amazon using passport-vkontakte. What causes the "VkontakteAPIError" error?
Please tell me, either the skis don’t go, or I’m a fool and don’t see the obvious) I am doing
authorization using passport-vkontakte for VK. Locally everything works fine. In particular, the callback is set to something like http://localhost:1337/auth/vkontakte/callback
. In the settings of the VK application, I also set it http://localhost:1337
.
But when transferred to amazon, it broke, and rather strangely. I changed the callback and site address in VK to
http://my-amazon-domain.tk:1337/auth/vkontakte/callback
, everything, in theory, should have worked, but I get an exceptionVkontakteAPIError: Validation required: please open redirect_uri in browser
TokenError: Code is invalid or expired.,
Answer the question
In order to leave comments, you need to log in
https://vk.com/dev/need_validation
In some cases (for example, when trying to enter VK from abroad), a request is made for additional validation.
passport-vkontakte, after successful authorization via OAuth2, makes an additional request to the VKontakte API to get data about the currently logged in user. And at this moment there is a problem with this redirect.
But the redirect is sent there to https://oauth.vk.com/blank.html# and it is not clear how to process it on the server.
I have the same thing, in hosting abroad. But not on Amazon. Haven't found a solution yet.
Here is the issue on github about this: https://github.com/stevebest/passport-vkontakte/is...
Make sure that the type of your VKontakte application is selected correctly.
For authorization from the site, the type "Website" must be specified, for the mobile application - "Standalone".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question