-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is "Authorization Code + PKCE" Supported? #685
Comments
@garnerp PKCE is currently not supported. |
Yeah, sorry @garnerp. We intend to add support for it, as I appreciate it is now required for Open ID compliance. |
@iaincollins is there any way we can get involved in helping to implement PKCE? |
@iaincollins I very much need the "Authorization Code + PKCE" on a project i am working on. I can't login with the IdentityServer4 because of "code challenge" is needed. When will this be implemented in NextAuth or does anyone know a workaround to the code challenge with a custom provider? |
Did someone successfully get nextauth + identityserver4 to work ? |
Yes works fine, but never got the PKCE to work since its not supported in this package. Basically you just need to follow the examples in the documentation and you will have something to start with. |
This comment has been minimized.
This comment has been minimized.
@IkeLutra your insights are welcome on #941! @creteurlouis I recommend you create a separate question in the Discussions, or an issue with a public reproduction repository. This would accelerate the process of helping you! 🙂 |
We're at a decisive juncture on our project, and PKCE support is a deciding factor for us. We'd like to use next-auth in combination with Okta, using PKCE. I wondered whether the team or community had a sense of whether the linked PR (#941) was likely to make it into a release 'soon' (weeks) or not? We'd also be happy to test and contribute in any way we can. |
@nick-myers-dt If you want to test it out right now, I think you could clone the branch We are aiming for a |
@balazsorban44 I tried cloning the When I try to sign in with IdentityServer4 I'm redirected to this url (notice the |
Thanks @thulstrup, this is useful! I think I can see the issue. I'll hopefully be able to fix this later today, and I'll let you when you could try this again? |
Sure, that would be great. |
Replacing
with
seems to fix the |
So this issue has been solved, but I hit a wall. I was too naive to think that I could create a PKCE challenge and verifier as in the PR right now. The way it is now will create new challenge and verifier on every call, so the Provider won't be able verify anything. I have an idea but I have to discuss it with @iaincollins. I'll push my changes anyway tomorrow, so you can have a look |
🎉 This issue has been resolved in version 3.2.0-canary.29 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 3.3.0-canary.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What is the current status of PKCE support? Does NextAuth support PKCE now? |
Yes, it does. Set Tested with Auth0 and IDS4. Maybe even GitHub, but not 100%kn that one. Also make sure you have a fairly recent version (recommend 3.5.1 as of this writing) installed. |
Tried with Okta with bad results.
Clearly with client secret works fine as well described on Build a Next.js Application with TypeScript |
@joovnaz please open a bug report with a complete reproduction if you have issues. |
I've got the same error as @joovnaz, but looking at the url that okta returned there is one more clue: What is happening is that the okta provider is not using PCKE flow. the bold params, are the problematic ones Is there a way to pass this to the okta provider? |
For anyone who ends up on this issue from Google/other issue links, as per this discussion:
|
Your question
Does next-auth support "Authorization Code + PKCE"?
What are you trying to do
Trying to add a new provider using the "Authorization Code + PKCE" flow (Akamai, using a Public Client). I was able to generate a code_challenge and send that into the auth endpoint. I couldn't figure out how to send in the code_verifier though. I tried in the provider.params as it looks like that is what gets added to the postData, but its throwing an error.
The text was updated successfully, but these errors were encountered: