feat(account): VK ID web login to link a VK identity from a browser #166

Merged
developer merged 1 commits from feature/vk-web-link into development 2026-07-03 16:09:57 +00:00
Owner

VK web-link vertical (deferred from the email-relay PR2). A browser has no signed VK Mini App launch params, so linking VK on the web uses VK ID's raw OAuth 2.1 flow (PKCE, no @vkid/sdk): the SPA redirects to VK's hosted login and returns with an auth code that the gateway exchanges server-side (confidential, under the VK "Web" app's protected key) for the trusted vk user id, then the existing link/merge machinery attaches or merges it.

  • backend: link.Service ConfirmVK/MergeVK/attachVK (KindVK), routes /user/link/vk[/merge].
  • gateway: internal/vkid confidential code exchange + link.vk.confirm/merge ops + config.
  • UI: lib/vkid (PKCE authorize redirect + callback), Profile 'Link VK'; merge re-auths (VK codes single-use); web-only.
  • deploy: VITE_VK_APP_ID + VITE_VK_ID_REDIRECT_URL + GATEWAY_VK_ID_CLIENT_SECRET (TEST_/PROD_).
  • tests: vkid unit, transcode link.vk, backend inttest, codec; docs ARCH/FUNCTIONAL(+ru)/gateway README.

Owner set the Gitea vars/secret; VK ID Web app + redirect URLs registered.

VK web-link vertical (deferred from the email-relay PR2). A browser has no signed VK Mini App launch params, so linking VK on the web uses VK ID's raw OAuth 2.1 flow (PKCE, no @vkid/sdk): the SPA redirects to VK's hosted login and returns with an auth code that the gateway exchanges server-side (confidential, under the VK "Web" app's protected key) for the trusted vk user id, then the existing link/merge machinery attaches or merges it. - backend: link.Service ConfirmVK/MergeVK/attachVK (KindVK), routes /user/link/vk[/merge]. - gateway: internal/vkid confidential code exchange + link.vk.confirm/merge ops + config. - UI: lib/vkid (PKCE authorize redirect + callback), Profile 'Link VK'; merge re-auths (VK codes single-use); web-only. - deploy: VITE_VK_APP_ID + VITE_VK_ID_REDIRECT_URL + GATEWAY_VK_ID_CLIENT_SECRET (TEST_/PROD_). - tests: vkid unit, transcode link.vk, backend inttest, codec; docs ARCH/FUNCTIONAL(+ru)/gateway README. Owner set the Gitea vars/secret; VK ID Web app + redirect URLs registered.
developer added 1 commit 2026-07-03 16:00:00 +00:00
feat(account): VK ID web login to link a VK identity from a browser
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 18s
CI / ui (pull_request) Successful in 1m4s
CI / conformance (pull_request) Successful in 9s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m39s
2c465c01d2
A browser has no signed VK Mini App launch params, so linking VK on the web uses
VK ID's raw OAuth 2.1 flow (PKCE, no @vkid/sdk): the SPA redirects to VK's hosted
login and returns with an authorization code, which the gateway exchanges
server-side (confidential, under the VK "Web" app's protected key) for the trusted
vk user id — then the existing link/merge machinery attaches or merges it.

- fbs LinkVKRequest{code, device_id, code_verifier}; codec + TS bindings.
- backend link.Service ConfirmVK/MergeVK/attachVK (KindVK, mirror Telegram),
  handleLinkVK[Merge], routes /user/link/vk[/merge], backendclient LinkVK[Merge].
- gateway internal/vkid confidential code exchange (id.vk.com/oauth2/auth);
  transcode link.vk.confirm/merge (registered only when configured) + config
  GATEWAY_VK_ID_{APP_ID,CLIENT_SECRET,REDIRECT_URL} + main wiring.
- UI lib/vkid (PKCE authorize redirect + callback), Profile "Link VK" control,
  boot callback handling; a merge re-authorizes for a fresh code (VK codes are
  single-use). Web-only (a redirect strands a Mini App webview).
- Deploy: VITE_VK_APP_ID + VITE_VK_ID_REDIRECT_URL build args + gateway env,
  ci.yaml/prod-deploy TEST_/PROD_ vars, compose/Dockerfile/.env.example/README.
- Tests: vkid exchange unit (string/number user_id, id_token fallback, errors),
  transcode link.vk, backend ConfirmVK/MergeVK inttest, codec encodeLinkVK.
- Docs: ARCHITECTURE §4, FUNCTIONAL(+ru), gateway README.
owner approved these changes 2026-07-03 16:09:31 +00:00
developer merged commit c680e695d3 into development 2026-07-03 16:09:57 +00:00
developer deleted branch feature/vk-web-link 2026-07-03 16:09:57 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#166