Skip to content

add VK ID backend#1743

Open
MeRuslan wants to merge 4 commits into
python-social-auth:masterfrom
otakuy:vk_id
Open

add VK ID backend#1743
MeRuslan wants to merge 4 commits into
python-social-auth:masterfrom
otakuy:vk_id

Conversation

@MeRuslan
Copy link
Copy Markdown

Summary

Adds a new VKIDOAuth2 backend for VK ID under the backend name vk-id.

VK has moved newer integrations to VK ID, which differs from the existing legacy vk-oauth2 backend:

  • uses id.vk.ru authorization/token/user-info endpoints
  • requires OAuth 2.1 style PKCE with code_challenge / code_verifier
  • returns and requires device_id during code exchange
  • may return callback data either as flat query params or as a JSON payload

The existing VKOAuth2 backend and vk-oauth2 provider name are left unchanged for backward compatibility.

Docs

@nijel
Copy link
Copy Markdown
Member

nijel commented May 18, 2026

Can you please also add documentation to https://github.com/python-social-auth/social-docs?

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 86.99187% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.93%. Comparing base (e0c5c02) to head (8f8a3d2).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
social_core/backends/vk.py 79.22% 8 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1743      +/-   ##
==========================================
+ Coverage   83.90%   83.93%   +0.02%     
==========================================
  Files         341      341              
  Lines       12109    12230     +121     
  Branches      575      584       +9     
==========================================
+ Hits        10160    10265     +105     
- Misses       1742     1750       +8     
- Partials      207      215       +8     
Flag Coverage Δ
unittests 83.93% <86.99%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new VKIDOAuth2 OAuth2 backend (vk-id) to support VK’s newer “VK ID” integration (PKCE, device_id, and optional JSON payload callback handling) while keeping the legacy vk-oauth2 backend unchanged.

Changes:

  • Introduces VKIDOAuth2 backend with VK ID endpoints, PKCE (code_challenge/code_verifier), device_id handling, and payload callback parsing.
  • Adds comprehensive backend tests covering standard callback params and payload-based callbacks.
  • Updates CHANGELOG.md to note the new backend.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
social_core/backends/vk.py Adds the VKIDOAuth2 backend implementation (VK ID endpoints, PKCE, payload parsing, device/user info handling).
social_core/tests/backends/test_vk.py Adds test coverage for the new backend, including PKCE + device_id assertions and payload callback flow.
CHANGELOG.md Documents the addition of the VK ID OAuth2 backend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread social_core/backends/vk.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants