Skip to content

Conversation

@afansv
Copy link

@afansv afansv commented May 3, 2025

Problem

The existing VK (VKontakte) OAuth provider in Kratos is now outdated and unusable for newly registered applications, as VK OAuth no longer works for new apps.

Solution

VK ID is the modern official alternative that consolidates login across three popular CIS-region services: VKontakte (VK), Mail.Ru, and Odnoklassniki (OK.ru). Supporting VK ID significantly improves the social login experience for users in the CIS region.

Changes

  • The new provider has been implemented as a single unified VK ID provider, even though it supports authentication from all three platforms.
  • The configuration schema has been extended to support the VK ID provider. Existing configurations for the legacy VK provider remain compatible, so no existing deployments will break. In other words, there are no breaking changes in functionality, only additional config schema fields.

Related issue(s)

No issues or design documents are associated with this change.

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

This addition enables reliable social login for the major CIS platforms, which is highly valuable for Kratos users in those regions. Administrators should update their social provider configurations to use the new VK ID provider as needed. Documentation in the Ory docs repository will be updated soon to describe the new provider and its configuration options. Please review the implementation and tests and suggest any improvements.

@afansv afansv requested review from a team and aeneasr as code owners May 3, 2025 14:46
@CLAassistant
Copy link

CLAassistant commented May 3, 2025

CLA assistant check
All committers have signed the CLA.

@afansv afansv marked this pull request as draft May 3, 2025 16:01
@afansv afansv marked this pull request as ready for review May 3, 2025 17:42
@renom
Copy link

renom commented Jun 9, 2025

@aeneasr if you're going to merge this MR, please consider merging updated Yandex provider from #4158.

@Molandrious
Copy link

@afansv Change base domain for VK from id.vk.com to id.vk.ru.
com will be deprecated soon

PhoneNumber: response.User.Phone,
PhoneNumberVerified: response.User.Phone != "", // VK ID returns only verified phone number
Gender: gender,
Birthdate: response.User.BirthDay,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Глянь мой MR.

Я там подгоняю формат из российского в международный:

t, err := time.Parse("2.1.2006", user.BirthDay)
if err != nil {
	return nil, errors.WithStack(herodot.ErrInternalServerError.WithReasonf("%s", err))
}
birthDay := t.Format("2006-01-02")

Picture: response.User.Avatar,
Email: response.User.Email,
EmailVerified: response.User.Email != "", // VK ID returns only verified email
PhoneNumber: response.User.Phone,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И ещё от VK телефон приходит без + в начале. Не знаю, важно это или нет, но я обновлял телефон так:

if len(userInfo.User.Phone) > 0 && userInfo.User.Phone[0] != '+' {
	userInfo.User.Phone = "+" + userInfo.User.Phone
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants