Developing VK ID Authentication
VK ID is current replacement for deprecated VK SDK. VKontakte relaunched authentication in 2023-2024: new SDK with OneTab support (authorization via VKontakte app without password entry), improved PKCE flow, separate documentation for mobile. Old VKSdk deprecated, though some projects still use it.
Current SDK: VKID
New SDK called VKID (don't confuse with old VKSdk). For iOS — Swift Package: https://github.com/VKCOM/vkid-ios-sdk. For Android — Gradle: implementation "com.vk.id:vkid:latest".
Main UX advantage of new SDK: if VKontakte app installed on device, authorization through it with one tap without login/password — "OneTab" authorization. Without VKontakte — OAuth2 PKCE in browser.
Setup: in VK developer personal account create app, get client_id. On iOS add URL Scheme vk{client_id} for redirect handling. On Android — Intent Filter on vk{client_id}://vk.com/blank.html.
// iOS
let vkid = VKID(config: .init(appCredentials: .init(clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET")))
let sheet = OneTapBottomSheet(
serviceName: "MyApp",
targetActionText: .signIn,
oneTapButton: .init(
height: .medium(),
cornerRadius: 8
)
)
// Show via UISheetPresentationController
After authorization get accessToken and userId. To get profile data — VK API request: users.get with fields photo_200,screen_name. Server token verification via secure.checkToken API method.
Key detail: VK ID tokens have TTL, need refresh mechanism. New VKID SDK manages refresh automatically with proper setup.
Timeline: 4-7 working days. Includes new VKID SDK integration, OneTab and browser flow handling, server verification.







