Ensure force PKCE always forces PKCE, fixes #1654#1773
Ensure force PKCE always forces PKCE, fixes #1654#1773ThisIsMissEm wants to merge 1 commit intodoorkeeper-gem:mainfrom
Conversation
|
how does this affect implementations currently forcing public apps to use pkce, but not confidential ones? unless i'm misunderstanding, this is a breaking change i'd have to pass on to third-party integrators, or disable the |
@gkemmey This would be a breaking change, in which case, I'd recommend disabling Keep in mind this would not affect client credentials grant flow, only authorization code grant flow. |
@ThisIsMissEm Can you say a little more about this perspective? While I love the idea of moving more providers and clients in the direction of the most secure methods of operation available, having some in-between functionality (i.e. a "partially on" state as the code works prior to this change) seems hugely beneficial for enabling apps to move in this more secure direction incrementally. I understand that's not ideal and makes for more code to maintain (I love the simplicity of this change!), but there seems like a reasonable amount of upside to that incremental/layered approach. |
|
If anything, we'd add a So like: Or something (you wouldn't have the grant type in here, because it's only But you could probably also do this with a custom extension, I think, in like the PreAuth code? |
|
Hey all. Thanks for the great insights! This indeed can affect existing projects & customers so I think if we need to add some warning message? Or at least a changelog entry with a |
|
@nbulaj yeah, we could ship this and my other changes as a 6.x and just indicate major breaking changes |
|
if we ship this as is, there will be no doorkeeper-supported way to recover the existing behavior where pkce is only required for public clients. i'd like to continue forcing public clients to use pkce, but avoid forcing third-party integrators to update their confidential oauth apps to use pkce. are we deciding that behavior will have to be patched in? if not and we’re willing to make a breaking change to |
|
@gkemmey that looks like overall a good change, but I think we should continue having |
|
@gkemmey if you want, open up that branch as a pull request against ThisIsMissEm:fix/allow-force-pkce-for-all-clients and I'll rebase it in, keeping authorship. |
|
that makes perfect sense! opened the pr here. don't feel like you have to use it if it's easier to just make the changes yourself. thanks! 🙏 |
|
Thanks both of you @ThisIsMissEm and @gkemmey how can we help to make this change go forward? I've done a quick review and didn't see anything off (but I'm new to the gem so I'm trusting @nbulaj 's approval of April 2025 😊 ) |
|
Let me try to get to it today. The tldr on my end is that this work was primarily for the mastodon project, and my funding wasn't sustainable so I've had to focus on other things to earn money. |
|
I started merging in that change, but the test coverage here doesn't make sense to me right now. see: https://github.com/ThisIsMissEm/doorkeeper/pull/1/changes#r2750112774 |
Summary
Previously
force_pkceoption could be bypassed if the client was confidential, that's no longer the case with the Security Practices BCP, which recommends PKCE for all clients.Fixes #1654
This is technically a breaking change
Other Information
We could perhaps simplify the tests a little, but I'm not sure that's necessary right now.