Not working login to VK from aws.
ykravv opened this issue · comments
Hi,
could you please help me with my issue?
Now I'm working on login through VK using passport-vkontakte. On my local machine all working well.
In vk app settings "Site address": "http://localhost:1337",
callbackUrl is "http://localhost:1337/auth/vkontakte/callback".
If I move my app to amazon server, login is broken.
"Site address": "http://my-amazon-domain.tk:1337"
callbackUrl: "http://my-amazon-domain.tk:1337/auth/vkontakte/callback"
When I make attempt to login, I received exception
It's some strange exception, and I can't find possibility to fix them.
Maybe you have some suggestions for resolving this problem?
Whoa, I never even expected this branch of code to execute, to be honest! :)
Seems like vk.com doesn't like something in your settings. Hard to tell exactly what, 'cause their docs are broken. DUUUUROOOV!
Make sure you have "Site Address" and "Base Domain" settings both pointing to whatever domain you are using in production. Also, I like to have two separate sets of client id + secret registered at vk for both localhost
and production domain.
There is an explanation on this page:
https://vk.com/dev/need_validation
There are some cases when VK needs additional validation. E.g. when the user logins from an unusual place.
So you need to redirect user to the provided url on this error.
I've also got this error. Solution is simple - delete your current VK application and create new one, but not as standalone application, but as web-application. This helped me
as standalone application, but as web-application. This helped me.
+1
"not as standalone application, but as web-application" - work for my case
its vk security check, if you login from unusual place, it can ask to type phone number of account to verify. you can use https://github.com/Yashko/vk-validation-node (instructions in russian)