-
Notifications
You must be signed in to change notification settings - Fork 116
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
Fix Doorkeeper 5.2 compatibility #83
Conversation
…behave accordingly
@nbudin thanks for the report! 👍 Technically we're trespassing on internal Doorkeeper APIs, so I'm not sure if it can really be considered a "breaking change" 😛 But I stumbled across some other breakage with Doorkeeper 5.2, so I think I'll just require that as a minimum for doorkeeper-openid_connect 1.7.0 (or 2.0.0? 🤔) and started #85 to get Doorkeeper 5.2 running, and also possibly Rails 6. In the meantime I also released 1.6.3 which specifically requires Doorkeeper < 5.2. Let me know if that works for you! I'll close this PR. |
@toupeira That seems reasonable, thanks! I'm currently using my fork on the one project that needs it, and I can keep doing so until you release the next version. |
Hi @toupeira . Sorry for the closed issue, but it the main topic here
I'm open for the suggestions on how we can make the API open for I'm thinking about a plugin system for Doorkeeper for a long time, and it must simplify creating of integrations and extensions for the gem. A have PoC, but let's first start with the above. Thanks! |
@toupeira It works for me! |
Doorkeeper 5.2.0 seems to have changed the method signature for
OAuth::PreAuthorization#initialize
. It previously took aclient
as a parameter, but now expects a:client_id
key inattrs
instead. (This probably should have been considered a breaking change but doesn't seem to have been.)Because of that, trying to log in when the server is using this gem with doorkeeper 5.2.0 gives a traceback ending in:
This patch attempts to fix it while still maintaining compatibility with older Doorkeeper releases. To do that, it checks both the type of the
client
parameter and whether or not the super initializer has a parameter calledclient
. It's a little complicated but it seems to work.