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

Bump doorkeeper 5.5 and define body method for authorization response to support response_mode=form_post #138

Merged

Conversation

linhdangduy
Copy link
Contributor

@linhdangduy linhdangduy commented Jan 1, 2021

Description

Resolves #92

Because doorkeeper already supported response_mode parameter on master branch, so I create this pull to support this response_mode=form_post on doorkeeper-openid_connect.

What did I do

Caution ⚠️

Doorkeeper will released the response_mode=form_post from v5.5.0, these PR should be merged and released at that time.

Update

Doorkeeper released v5.5.0! So this pull is ready to be merged 🎉

@linhdangduy linhdangduy changed the title ♻️ define body method for authorization response to support response_mode=form_post Define body method for authorization response to support response_mode=form_post Jan 1, 2021
@linhdangduy linhdangduy force-pushed the support_form_post_response_mode branch from 58aecb9 to 42de5bf Compare January 1, 2021 04:25
@linhdangduy linhdangduy changed the title Define body method for authorization response to support response_mode=form_post [Do not merge] Define body method for authorization response to support response_mode=form_post Jan 1, 2021
@linhdangduy linhdangduy force-pushed the support_form_post_response_mode branch from 42de5bf to 4e67aff Compare February 28, 2021 02:43
@linhdangduy linhdangduy changed the title [Do not merge] Define body method for authorization response to support response_mode=form_post Define body method for authorization response to support response_mode=form_post Feb 28, 2021
@linhdangduy linhdangduy changed the title Define body method for authorization response to support response_mode=form_post Bump doorkeeper 5.5 and define body method for authorization response to support response_mode=form_post Feb 28, 2021
Copy link
Member

@toupeira toupeira left a comment

Choose a reason for hiding this comment

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

Overall this LGTM, thanks for the contribution! ❤️

I've left some minor comments, please take another look.

doorkeeper-openid_connect.gemspec Show resolved Hide resolved
lib/doorkeeper/openid_connect.rb Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Eric-Guo added a commit to thape-cn/oauth2id that referenced this pull request Mar 11, 2021
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.

Good work 🤝

@linhdangduy linhdangduy force-pushed the support_form_post_response_mode branch from c31b6a6 to d07ba31 Compare March 21, 2021 09:28
@linhdangduy
Copy link
Contributor Author

linhdangduy commented Mar 21, 2021

@nbulaj @toupeira

After fixing the comments of @toupeira, I have checked if there are things we have to replace or fix when moving to Doorkeeper v5.5. Finally I find out some of them, added two more commits, and it seem to be ok for now.
Explaining below:

1. 0b681cb delete unnecessary support for dookeeper < v5.5

  • Because the minimize doorkeeper's version is v5.5 now, so we can drop the code support for Doorkeeper version that less than v5.5

2. d07ba31 update: using response_mode which supported by doorkeeper v5.5

  • Currently, this gem has a class (doorkeeper/openid_connect/response_mode) responsible for getting response_mode from response_type. It is added in this pull. But it is obsolete because response_mode already be supported from doorkeeper v5.5
  • So I deleted the above doorkeeper-openid's response_mode class, and fix response_on_fragment? method in lib/doorkeeper/openid_connect/oauth/pre_authorization.rb file, which getting response_mode by using authorization_response_flows in doorkeeper config. (With a comment show that this implementation need to be used in doorkeeper later, so we don't need overwrite this method)
  • Beside that, in the method for handling oidc errors (handle_oidc_error!) in lib/doorkeeper/openid_connect/helpers/controller.rb file, instead of defining how to response in this gem, I just use the method redirect_or_render which is already implemented in doorkeeper. A @authorize_response instance variable for authorizations_controller need to be defined, because when response_mode is form_post, @authorize_response is used in form_post template.

Please leave questions if there are somethings unclear. Thanks!

@toupeira
Copy link
Member

@linhdangduy sorry for the delay, this fell off my radar again 🙈

This all LGTM now, thanks a lot for your work on this, and also the cleanups! ❤️

I'll merge this and will prepare a new release shortly, I'll bump the version to 1.8.0 due to the Doorkeeper 5.5 requirement. 👍

@toupeira toupeira merged commit 1b62c32 into doorkeeper-gem:master Apr 20, 2021
@linhdangduy linhdangduy deleted the support_form_post_response_mode branch April 21, 2021 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is the form_post response_mode supported?
3 participants