Open Starefossen opened 11 months ago
Had the same problem, but was able to get it to work by adding nonce to the check.
Slack({
checks: ['pkce', 'nonce']
})
It seems there is a bug where 'nonce' is being checked even when it is not supposed to be. Explicitly including it as a target can circumvent this issue.
"next": "14.0.4",
"next-auth": "^5.0.0-beta.5",
"react": "^18",
If 'nonce' is not a check target, it returns undefined. https://github.com/nextauthjs/next-auth/blob/60cb83ea04032c0c69b499d931c679e2104a4e68/packages/core/src/lib/actions/callback/oauth/checks.ts#L205-L213
Processed as o.expectNoNonce without checking whether the Nonce is subject to check or not. https://github.com/nextauthjs/next-auth/blob/60cb83ea04032c0c69b499d931c679e2104a4e68/packages/core/src/lib/actions/callback/oauth/callback.ts#L133-L139
Yes, this worked for me. Thanks a lot @neptaco 💯
export const config = {
providers: [
SlackProvider({
checks: ['pkce', 'nonce'],
…
})
]
}
This is still an issue with 5.0.0-beta.19.
Provider type
Slack
Environment
System:
Binaries:
Browsers:
npmPackages:
Reproduction URL
https://github.com/Starefossen/next-auth-example
Describe the issue
With standard config for Slack Provider auth. After authenticating with Slack the return request fails with the following error:
unexpected ID Token "nonce" claim value
How to reproduce
npm run dev
/api/auth/signin
Expected behavior
Expected the user to be logged in successfully.