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

Not passing required parameters results in a 500 #78

Closed
isabellechalhoub opened this issue Jul 16, 2019 · 1 comment · Fixed by #80
Closed

Not passing required parameters results in a 500 #78

isabellechalhoub opened this issue Jul 16, 2019 · 1 comment · Fixed by #80
Labels

Comments

@isabellechalhoub
Copy link

The Doorkeeper::AuthorizationsController checks to see whether or not required parameters are present by running pre_auth.authorizable? in the new action.

This gem modifies the behavior of the :authenticate_resource_owner! before filter that runs prior to the new action. One of the modifications is to inspect the pre_auth object (an instance of OAuth::PreAuthorization) and look at its scopes.

The OAuth::PreAuthorization#scopes method in turn fires the build_scopes private method, which calls client.application.scopes. This method assumes that client is present. However, if you do not initialize the object with @client, it obviously blows up. This has not been an issue in Doorkeeper itself, because usually the OAuth::PreAuthorization object is assumed to be valid. However, this OpenID Connect gem inspects the object before it has been validated.

We have a PR to add a validation check before trying to inspect the scopes.

@toupeira
Copy link
Member

toupeira commented Aug 9, 2019

Thanks again, you can give this a try with the new version 1.6.2.

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

Successfully merging a pull request may close this issue.

2 participants