Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

priority on max age and prompt #224

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [#216] Test against Rails 7.1, 7.2, 8.0.
- [#221] Avoid raising invalid_request error on prompt=create
- [#220] Define priority on possible prompt values to statically & successfully process multiple prompt values
- [#224] Define priority between max_age & prompt

## v1.8.10 (2024-11-29)

Expand Down
2 changes: 1 addition & 1 deletion lib/doorkeeper/openid_connect/helpers/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def authenticate_resource_owner!
super.tap do |owner|
next unless oidc_authorization_request?

handle_oidc_prompt_param!(owner)
handle_oidc_max_age_param!(owner)
handle_oidc_prompt_param!(owner)
end
rescue Errors::OpenidConnectError => e
handle_oidc_error!(e)
Expand Down
10 changes: 9 additions & 1 deletion spec/controllers/doorkeeper/authorizations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ def expect_successful_callback!
expect(response).to redirect_to('/select_account')
end

# FIXME:
it 'when login+consent' do
authorize! prompt: 'login consent'
expect(response).to redirect_to('/reauthenticate')
Expand Down Expand Up @@ -373,6 +372,15 @@ def expect_successful_callback!
expect(response).to redirect_to '/reauthenticate'
end
end

context 'when used along with prompt=select_account' do
it 'renders the authorization form' do
user.update! current_sign_in_at: 5.seconds.ago
authorize! max_age: 1, prompt: 'select_account'

expect(response).to redirect_to '/select_account'
end
end
end

describe '#reauthenticate_oidc_resource_owner' do
Expand Down