Skip to content
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

NoMethodError: undefined method `openid_request' for #<Doorkeeper::AccessGrant:0x0000000308707050> #217

Open
shelmire opened this issue Dec 9, 2024 · 0 comments

Comments

@shelmire
Copy link

shelmire commented Dec 9, 2024

Note that this is within a testing context, so I do suspect it may be an issue with the ActiveSupport hooks not triggering normally (and that testing environment is rather complex). However, I haven't run into this sort of problem with any other gem. I'm writing my tests first in order to exercise the functionality. Regular OAuth request/grant/token flow works fine. As soon as I set up this gem, however, I run into issues with the existing functionality. I haven't exercised it outside of the testing context.

Error:NoMethodError: undefined method 'openid_request' for #<Doorkeeper::AccessGrant:0x0000000308707050>

This happens when hitting Doorkeeper::OpenidConnect::OAuth::AuthorizationCodeRequest#after_successful_response in lib/doorkeeper/openid_connect/oauth/authorization_code_request.rb

It appears to be related to the way the loading happens in lib/doorkeeper/openid_connect/orm/active_record.rb.

I am not using any custom classes for Doorkeeper.

I am able to work around the issue by requiring the classes directly in my own config/initializers/doorkeeper_openid_connect.rb:

require 'doorkeeper/openid_connect/orm/active_record/access_grant'
require 'doorkeeper/openid_connect/orm/active_record/request'

Hoping that someone else may have run into this issue, or have familiarity with why these hooks might not be loading.

I have a workaround for now, and I may continue to poke at this issue - I'll update here if I find new information which may help others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant