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

Handle trying authorization with client credentials #1402

Conversation

bforma
Copy link
Contributor

@bforma bforma commented Apr 29, 2020

When trying to start a new authorization for an application with grant
flow 'client_credentials' (which also has redirect_uri nil), the
following error occurs:

NoMethodError: undefined method `split' for nil:NilClass

lib/doorkeeper/oauth/helpers/uri_checker.rb:66 valid_for_authorization?
lib/doorkeeper/oauth/pre_authorization.rb:89 validate_redirect_uri
lib/doorkeeper/validations.rb:13 block in validate
lib/doorkeeper/validations.rb:12 each
lib/doorkeeper/validations.rb:12 validate
lib/doorkeeper/validations.rb:19 valid?
lib/doorkeeper/oauth/pre_authorization.rb:32 authorizable?
app/controllers/doorkeeper/authorizations_controller.rb:8 new

Moving the validation for supporting grant flows up, prevents this
error from happening (and shows an error message to the user, instead of
a 500 Internal Server Error).

When trying to start a new authorization for an application with grant
flow 'client_credentials' (which also has redirect_uri nil), the
following error occurs:

NoMethodError: undefined method `split' for nil:NilClass

lib/doorkeeper/oauth/helpers/uri_checker.rb:66 valid_for_authorization?
lib/doorkeeper/oauth/pre_authorization.rb:89 validate_redirect_uri
lib/doorkeeper/validations.rb:13 block in validate
lib/doorkeeper/validations.rb:12 each
lib/doorkeeper/validations.rb:12 validate
lib/doorkeeper/validations.rb:19 valid?
lib/doorkeeper/oauth/pre_authorization.rb:32 authorizable?
app/controllers/doorkeeper/authorizations_controller.rb:8 new

Moving the validation for supporting grant flows up, prevents this
error from happening (and shows an error message to the user, instead of
a 500 Internal Server Error).
@doorkeeper-bot
Copy link

1 Warning
⚠️ Please include a changelog entry.
You can find it at CHANGELOG.md.You can skip this warning only if you made some typo fix or other small changes that didn’t affect the API.

Here's an example of a CHANGELOG.md entry:

- [#1402] Handle trying authorization with client credentials.

Generated by 🚫 Danger

Copy link
Member

@nbulaj nbulaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please do what bot suggested? Thanks

@nbulaj nbulaj merged commit ca3b644 into doorkeeper-gem:master Apr 30, 2020
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

Successfully merging this pull request may close these issues.

3 participants