C
C
cryptograf2014-01-24 17:44:59
Amazon Web Services
cryptograf, 2014-01-24 17:44:59

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 exception
VkontakteAPIError: Validation required: please open redirect_uri in browser

When you try to make the requested open redirect_uri in browser, the following falls:
TokenError: Code is invalid or expired.,
Which, in principle, is not strange.
Can anyone come across, and there is a solution to the problem?
They suggested that there might be a problem in amazon itself, but maybe there is still a solution to the problem?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
alexeimoisseev, 2014-03-22
@alexeimoisseeev

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...

D
dbezrukov, 2015-04-14
@dbezrukov

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".

J
jjek, 2014-03-31
@jjek

Can install VPN daemon on server and open redirect_uri in browser?

Y
Yashko, 2016-07-30
@Yashko

Try https://github.com/Yashko/vk-validation-node

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question