Email from Vkontakte social connection

How to get the email on an user accessing my website using Vkontakte social connection?
I found this and this but still I can get a solution.
Thank you!

Hi @giovannilaperna

It looks like the second post you linked shows how to set up a custom social connection which will allow you to request the email.

Were you able to try this method?


I tried with the following but didn’t work:

context.accessToken[namespace + 'email'] =;

I have the following scopes:

openid profile email offline_access does not exist accordingly to your documentation.

Any suggest?

This is crucial for me since 1/3 of my users will be using Vkontakte to login.

I’m now trying to set up a custom social connection but for some reason it fails.
I contacted vKontakte support for some help because I always get:


I don’t know what invalid user id means.

This is solved.

In case someone needs it, the settings and code for Vkontakte custom social connection to get the user email are:

Authorization URL:
Token URL :
Scope: email
Fetch User Profile Script:

function fetchUserProfile(accessToken, context, callback){
      const profile = {
        id: context.user_id,
callback (null, profile);
1 Like

Thanks for posting your solution!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.