Menu

VKontakte

RootAuth supports VKontakte (VK) sign-in. Once enabled, users can select VK on the sign-in or sign-up page and complete authentication through VK authorization.

Path: Sign in to the RootAuth Console → open the target application → select Configuration in the top navigation → Application Management - Authentication Configuration → Providers.

 

1. Before You Start

Before configuring VK sign-in, prepare the following:

  • A VK personal account.
  • A Website-type application created in the VK developer platform.
  • The VK application's Application ID and Secure Key.
  • Your application domain, which is required to configure the OAuth callback URL.

VK validates the OAuth redirect URI. Configure the Callback URL shown in the RootAuth Console in your VK OAuth client authorization settings, and make sure the two URLs match exactly.

 

2. Enable VK in the RootAuth Console

Find VKontakte (VK) in the Providers list and select Enable.

In the configuration dialog, turn on VK sign-in and complete the following fields:

Setting Description
Application ID The Application ID (App ID) of your VK application. Required.
Secure Key The Secure Key of your VK application. Required.
Callback URL System-generated, read-only, and copyable. Add this URL to your VK OAuth client authorization settings.
Domain The domain used by the current application. You can copy it for your VK application configuration.
Authorization scopes

basic_profile is required and cannot be cleared. It returns identity data such as name, gender, user ID, and avatar.

email is optional and selected by default. It retrieves the user's email address. To retrieve it, keep this scope selected and enable email permission in your VK application; otherwise, VK will not return the user's email.

Sign-in mode Fixed as Available for sign-in and sign-up.
Account linking Enabled by default. When enabled, choose Automatic linking or Required linking. Turn it off to disable account linking.

When you have finished, select Save. After a successful save, VK is shown as Enabled and the button changes to Manage. Select Manage whenever you need to change the configuration.

 

 

3. Account Linking Settings

RootAuth uses the VK user ID as the user's unique VK identifier. When VK returns an email address, RootAuth uses it as an additional matching identifier.

3.1 When No Email Is Available

If the email scope is not selected or VK does not return an email after authorization, RootAuth matches accounts only by VK user ID:

  • If the same VK user ID already exists, RootAuth signs the user in to that account.
  • If no matching VK user ID exists, RootAuth creates a new account and links the VK identity.

In this scenario, RootAuth does not display an account-linking or identity-verification dialog.

 

3.2 When an Email Is Available

If the email returned by VK matches an existing account, RootAuth applies the selected Account linking setting:

Setting Behavior
Automatic linking RootAuth automatically links the VK identity to the existing account with the same email and signs the user in. If no existing account matches, RootAuth creates a new account. No user action is required.
Required linking RootAuth shows the confirmation and email identity-verification flow only when the email matches. After successful verification, RootAuth links the VK identity to the existing account and signs the user in. If the user cancels or fails verification, the VK sign-in or sign-up attempt fails. If no existing account matches, RootAuth creates a new account.
Account linking off RootAuth does not automatically link accounts with the same email. Even when the VK email matches an existing RootAuth account, RootAuth treats the VK identity as a separate account.

When you select Required linking, you can also configure the callback URL after linking. RootAuth provides a default URL. If you use a custom URL, ensure that the page can continue the account-linking and identity-verification flow.

 

 

 

4. How Users Sign In with VK

After VK is enabled, the sign-in and sign-up pages display a VK button. When users select VK, they are redirected to the VK authorization page.

After the user authorizes VK, RootAuth automatically:

  1. Retrieves the VK user profile and authorized email information.
  2. Looks for an existing VK identity link using the VK user ID.
  3. Determines whether to link an existing account based on email availability and the account-linking setting.
  4. Signs the user in to an existing account, or creates a new account and links the VK identity.

 

 

 

5. Link or Unlink a VK Account

In addition to the sign-in and sign-up flow, your application can use the API to let signed-in users link or unlink a VK account:

  • Link VK: After your frontend completes VK OAuth authorization, submit the resulting code or access_token to RootAuth. After validation, RootAuth links the VK user ID and any available email to the current account.
  • Unlink VK: When a signed-in user calls the unlink API, RootAuth removes the VK link from the current account.

The RootAuth Console does not provide an administrator interface for manually linking or unlinking VK accounts. Applications should implement user-initiated linking and unlinking through the API.

 

6. View a User's VK Authentication Method

After a user signs in, signs up, or links VK, open the relevant user in User Management and view the VK record in Authentication methods.

Field Description
Authentication method VK or VKontakte, displayed with the VK icon.
Identifier The VK email address is displayed first. If VK does not return an email, the VK user ID is displayed.
Last used The most recent time the user signed in with VK.

After an application unlinks VK through the API, the VK authentication method is removed from the user details page.

 

7. Logs and Identifier Display

RootAuth records VK-related actions in Audit Logs → User Behavior Logs.

Event type Description
VK sign-up A user creates a new account through VK.
VK sign-in A user signs in to an existing account through VK.
Link VK A signed-in user links VK through the application.
Unlink VK A signed-in user unlinks VK through the application.

 

8. Integration Methods

VK sign-in supports two integration methods:

Method Description
Hosted integration Use RootAuth-hosted sign-in and sign-up pages. Once VK is enabled, the VK sign-in button is displayed automatically.
API integration Build the VK sign-in entry in your application and use the RootAuth API to complete sign-in, linking, and unlinking.

For detailed integration instructions, see the Developer Integration Guide.

 

9. Disable VK Sign-In

To disable VK sign-in, open the VK management dialog, turn off the switch, and save.

After VK sign-in is disabled:

  • The VK button no longer appears on sign-in and sign-up pages.
  • Saved VK application credentials are retained.
  • Existing users' VK links are not removed.
  • You can reuse the saved configuration if you enable VK again later.

If a user sees a cached, older sign-in page and selects VK, RootAuth blocks the request and indicates that sign-in failed. The user can refresh the page to retrieve the latest sign-in configuration.

Previous
WeChat
Next
WhatsApp
Last modified: 2026-07-17Powered by