providers/vk
default()β
default<
P
>(options
):OAuthConfig
<P
>
Add VK login to your page.
Setupβ
Callback URLβ
https://example.com/api/auth/callback/vk
Configurationβ
import Auth from "@auth/core"
import VK from "@auth/core/providers/vk"
const request = new Request(origin)
const response = await Auth(request, {
providers: [VK({ clientId: VK_CLIENT_ID, clientSecret: VK_CLIENT_SECRET })]
})
Resourcesβ
Notesβ
By default, Auth.js assumes that the VK provider is based on the OAuth 2 specification.
The VK provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
By default the provider uses 5.126 version of the API. See https://vk.com/dev/versions for more info. If you want to use a different version, you can pass it to provider's options object:
const apiVersion = "5.126"
providers: [
VkProvider({
accessTokenUrl: `https://oauth.vk.com/access_token?v=${apiVersion}`,
requestTokenUrl: `https://oauth.vk.com/access_token?v=${apiVersion}`,
authorizationUrl: `https://oauth.vk.com/authorize?response_type=code&v=${apiVersion}`,
profileUrl: `https://api.vk.com/method/users.get?fields=photo_100&v=${apiVersion}`
})
]
If you think you found a bug in the default configuration, you can open an issue.
Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.
Type parametersβ
Parameter | Default |
---|---|
P extends Record < string , any > | VkProfile |
Parametersβ
Parameter | Type |
---|---|
options | OAuthUserConfig < P > |
Returnsβ
OAuthConfig
< P
>