This fixes #1717, allowing a user to prevent using the plain method for PKCE code challenges, since using plain is deemed insecure (as noted in the PKCE RFC)
This is based off of #1732, I also have some local changes that pull in irb and debug gems for interactive debugging, which I found helpful when testing in the console via:
$ docker run -it --rm doorkeeper:test /srv/bin/console
Other Information
In validate_pkce_code_challenge_methods I did want to log an error if the database hadn't been configured for PKCE, however, due to how this code is instantiated, I wasn't able to get that working due to the model class not yet being loaded by bin/console (so I'm assuming issues may happen in actual usage too).
The error message does list the supported methods always as plain or S256 — to fix that, we'd need to parameterize the localisation message to receive the supported code challenge methods. I wasn't sure if I should make such a change here.
Summary
This fixes #1717, allowing a user to prevent using the
plain
method for PKCE code challenges, since usingplain
is deemed insecure (as noted in the PKCE RFC)This is based off of #1732, I also have some local changes that pull in irb and debug gems for interactive debugging, which I found helpful when testing in the console via:
Other Information
In
validate_pkce_code_challenge_methods
I did want to log an error if the database hadn't been configured for PKCE, however, due to how this code is instantiated, I wasn't able to get that working due to the model class not yet being loaded bybin/console
(so I'm assuming issues may happen in actual usage too).The error message does list the supported methods always as
plain or S256
— to fix that, we'd need to parameterize the localisation message to receive the supported code challenge methods. I wasn't sure if I should make such a change here.This also limits us to only ever supporting plain or S256, but to my knowledge no other PKCE code challenge methods exist, and doorkeeper wouldn't have support for them anyway due to how it hardcodes which ones it supports.