-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Custom provider with pkce
and state
checks but without client_secret
possible?
#3540
Comments
client_secret
possible?
client_secret
possible?pkce
and state
checks but without client_secret
possible?
Should be possible, check the |
I'm encountering the same issue while trying to use PKCE. The @balazsorban44 It would be great for |
So after messing around with the Okta({
clientId: process.env.OKTA_ID,
clientSecret: process.env.OKTA_SECRET, // not set
issuer: process.env.OKTA_ISSUER,
checks: ["pkce", "state"],
client: {
token_endpoint_auth_method: "none",
},
}) What do you all think about updating the config types so they no longer require |
@hboylan Thank you! I was stuck with the same issue using PKCE with Okta complaining about client_secret. I had resigned myself to using v3, but your config above worked for me with v4.1.2 Agree, this should be the default behaviour for PKCE providers, |
Just lost ~2 hours on this issue, I'm using a custom provider with PKCE and state, without any client secret. The documentation is not currently referencing this use case and I would have been unable to resolve this issue without @hboylan last reply (thank you for that). Could we merge this default PKCE behaviour or at least update the documentation ? |
This is the magic sauce right here. Three hours of debugging okta/next-auth and I finally come across this thread. Thank you. |
I don't think this should be closed? 🤔 The underlying issue is still there - |
Hey there! I spent quite some time trying to fix this, this is not even on the documentation. Thanks @hboylan btw your solution worked like a charm |
Hello! after using the solution from @hboylan, the |
This appears to now be broken due to yesterday's commit: |
@balazsorban44 This really needs re-opened 👍🏻 |
@rawkode please open a new issue with a reproduction. This is a 3y old issue marked as a question. I only saw this by accident, we don't monitor closed issues. 🙏 |
@rawkode if you can consistently reproduce an issue, please open a new issue. I just tried this locally using a Keycloak instance that supports public clients (no client_secret) passed, and I was logged in fine. I can't commit to check back on this issue, but if you open a new one, I would like to get to the bottom of this! 💚 |
Hello, All throwing The only value working with PKCE is an empty string : (next-auth 4.21.1) |
Question 💬
First: thanks a lot for your help! Really appreciate it. 🙏
My question: Is it possible to use a
next-auth
customprovider withpkce
andstate
checks but without aclient_secret
? I couln't figure it out.next-auth
always asks for a secret. 🤔background information
I try to use https://zitadel.ch and
auth-next
with a custom provider. I use theOIDC
-flow withchecks: ['pkce', 'state']
without aclient_secret
(as specified in: https://www.oauth.com/oauth2-servers/pkce/authorization-code-exchange/)Even though a client_secret is not required by specification,
next-auth
wants one. (see error message in "How to reproduce").I'm not entirely sure but maybe the option I'm looking for is
checks: ['pkce', 'state', 'nonce']
as discussed in #1565 (comment) but this seems not to be implemented.All existing providers I looked at seem to want a
client_secret
even though it's not best practice for SPA's.How to reproduce ☕️
web
and thepkce
flowclient_id
together with this configuration:Alltough a
client_secret
is officially not required,next-auth
would like to have one:Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
The text was updated successfully, but these errors were encountered: