nextauthjs / nextauthjs/next-auth

VK provider not working

Open
#11,633 23 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue providers
Dominant language
TypeScript
Stars
28.4k
Forks
4k
PR merge metrics
No merged PRs in 30d

Description

Provider type

Vk

Environment
  System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 5.75 GB / 15.93 GB
  Binaries:
    Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.15.6 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Spartan (44.19041.3570.0), Chromium (127.0.2651.74)
    Internet Explorer: 11.0.19041.3570
  npmPackages:
    @auth/prisma-adapter: ^2.4.2 => 2.4.2
    next: 14.2.5 => 14.2.5
    next-auth: ^5.0.0-beta.20 => 5.0.0-beta.20
    react: ^18 => 18.3.1
Reproduction URL

https://github.com/degibons/authjs-vk-issue

Describe the issue

When trying to sign in through a VK provider, an error is displayed
{"error":"invalid_request","error_description":"Code challenge method is unsupported"}

How to reproduce
  • Clone the repository from Reproduction URL and run npm install
  • Create and setup vk app https://id.vk.com/about/business/go
  • Create .env file from .env.example
  • Fill AUTH_VK_ID, AUTH_VK_SECRET variables from created vk app
  • Run docker db container npm run db
  • Push db schema npx prisma db push
  • Run dev app npm run dev
  • Go to localhost and click the button "SignIn"
Expected behavior

Normal sign in flow without this error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction repository, its .env.example, and the VK provider setup. Run the documented npm and database commands, then reproduce the sign-in flow from localhost and inspect where the VK authorization request is configured. Done means the flow completes without the “Code challenge method is unsupported” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, nodejs, react, typescript
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.