Provider – VKontakte

VK Sample

Table of contents

How to enable VKontakte login in WordPress

1. Create VKontakte App

  1. Navigate to https://vk.com/apps?act=manage
  2. Log in with your VK credentials if you are not logged in.
  3. Locate the blue “Create application” button and click on it.
  4. Enter the title of your app and select “Websie”.
  5. Fill “Site address” with the url of your homepage, E.g: http://yoursite.com
  6. Fill the “Base domain” field with your domain, E.g: yoursite.com
  7. When all fields are filled, create you app.
  8. You’ll be sent a confirmation code via SMS which you need to type to be able to create the app.
  9. Fill the form for your app and upload an app icon then hit Save.
  10. Pick Settings at the left-hand menu
  11. Add the following URL to the “Authorized redirect URI” field: http://yoursite.com/wp-login.php, where the yoursite.com is your domain.
  12. Save your app
  13. Find the necessary Application ID and Secure key at the top of this page

2. App setup

Once your VKontakte app is ready you’ll need to copy and paste the Application ID and Secure key to the VKontakte provider’s Settings tab. You can find the information at your VKontakte app’s Settings which you can reach from the left sidebar.

3. Verifying

Once your Application ID and Secure key has been added you need to verify the setup first. This verification helps you identify possible problems with the app.

Settings

VK Provider Configuration

Application ID

The Application ID of your VKontakte app. You can find it at your App → left menu: Settings.

Secure key

The Secure key of your VKontakte app. You can find it at your App → left menu: Settings.

Username prefix on register

Whenever a new user registers with their VKontakte account they can get a custom prefix so you can easily identify them.

Fallback username prefix on register

Whenever a new user registers with their VKontakte account and we can not generate a valid username from the first name or last name, a random username will be generated. With this option they can get a custom prefix so you can easily identify them.

Terms and conditions

This option can only be seen, if Terms and conditions is set to Show in Global Settings → Privacy tab. Here you can set custom Terms and Conditions for users who register with VKontakte. For more information please read our GDPR documentation.

Common error messages returned by VKontakte during verification

redirect_uri has wrong domain

{“error”:”invalid_request”,”error_description”:”redirect_uri has wrong domain, check application settings”}

The problem is that the entered Base domain field is not correct for your app. Check the 6th step of the App setup to fix the problem.

redirect_uri is incorrect

{“error”:”invalid_request”,”error_description”:”redirect_uri is incorrect, check application redirect uri in the settings page”}

The problem is that the entered Authorized redirect URI field is not correct for your app. Check the 11th step of the App setup to fix the problem.

client_id is incorrect

{“error”:”invalid_client”,”error_description”:”client_id is incorrect”}

The entered Application ID is not correct. Maybe the app with the entered ID was deleted. Go to the VKontakte provider → Settings and make sure that an existing App’s Application Id and Secure key was entered.

client_secret is incorrect

Error: invalid_client: client_secret is incorrect

The Secure key you copied from the VKontakte app is invalid. Make sure the correct one was copied.