nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.16k stars 3.35k forks source link

Apple provider OIDC response body error #9989

Open trevorpfiz opened 7 months ago

trevorpfiz commented 7 months ago

Environment

System: OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa) CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor Memory: 7.12 GB / 9.72 GB Container: Yes Shell: 5.8 - /usr/bin/zsh Binaries: Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm pnpm: 8.15.1 - ~/.local/share/pnpm/pnpm bun: 1.0.14 - ~/.local/share/pnpm/bun Watchman: 2024.01.22.00 - /home/linuxbrew/.linuxbrew/bin/watchman

Reproduction URL

https://github.com/trevorpfiz/create-t3-turbo/tree/main

Describe the issue

Vercel logs: [GET] /api/auth/callback/apple?state=7b0910e2-c162-4879-90df-ae62f0ee836e&code=cd8b3e50ce9784693a55eba3f9a50e99d.0.mrvss.7kNqSAL8hhZO5ExRWGWUoA&nxtPnextauth=callback%2Fapple status=302

error { error: 'invalid_client' } [auth][error] CallbackRouteError: Read more at https://errors.authjs.dev#callbackrouteerror

[auth][cause]: Error: TODO: Handle OIDC response body error
    at lx (/var/task/apps/nextjs/.next/server/app/api/auth/[...nextauth]/route.js:381:27458)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async lU (/var/task/apps/nextjs/.next/server/app/api/auth/[...nextauth]/route.js:381:33398)
    at async lz (/var/task/apps/nextjs/.next/server/app/api/auth/[...nextauth]/route.js:381:44750)
    at async lF (/var/task/apps/nextjs/.next/server/app/api/auth/[...nextauth]/route.js:381:49248)
    at async /var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:42484
    at async eI.execute (/var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:32486)
    at async eI.handle (/var/task/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:43737)
    at async Y (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:16:24556)
    at async Q.responseCache.get.routeKind (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:1025)
[auth][details]: {
  "provider": "apple"
}

image

followed this approach https://github.com/nextauthjs/next-auth/issues/6788#issuecomment-1658765772

How to reproduce

Navigate to https://create-t3-turbo-nextjs-dun.vercel.app/api/auth/signin and "Sign in with Apple". See error.

Expected behavior

I would expect the process to succeed.

trevorpfiz commented 7 months ago

8189