Skip to content

Commit

Permalink
remove unnecessary code after update to doorkeeper v5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
linhdangduy committed Mar 12, 2021
1 parent 4e67aff commit 99ef25e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 41 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Unreleased

- [#138] Support form_post response mode
- [#138] Support form_post response mode (This gem now requires Doorkeeper v5.5)

## v1.7.5 (2020-12-15)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The following parts of [OpenID Connect Core 1.0](http://openid.net/specs/openid-
- [Requesting Claims using Scope Values](http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims)
- [UserInfo Endpoint](http://openid.net/specs/openid-connect-core-1_0.html#UserInfo)
- [Normal Claims](http://openid.net/specs/openid-connect-core-1_0.html#NormalClaims)
- (From doorkeeper v5.5.0) [OAuth 2.0 Form Post Response Mode](https://openid.net/specs/oauth-v2-form-post-response-mode-1_0.html)
- [OAuth 2.0 Form Post Response Mode](https://openid.net/specs/oauth-v2-form-post-response-mode-1_0.html)

In addition we also support most of [OpenID Connect Discovery 1.0](http://openid.net/specs/openid-connect-discovery-1_0.html) for automatic configuration discovery.

Expand Down
37 changes: 15 additions & 22 deletions lib/doorkeeper/openid_connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
require 'doorkeeper/openid_connect/claims/claim'
require 'doorkeeper/openid_connect/claims/normal_claim'
require 'doorkeeper/openid_connect/config'
require 'doorkeeper/openid_connect/response_types_config'
require 'doorkeeper/openid_connect/engine'
require 'doorkeeper/openid_connect/errors'
require 'doorkeeper/openid_connect/id_token'
Expand Down Expand Up @@ -65,28 +64,22 @@ def self.signing_key_normalized
end
end

if defined?(::Doorkeeper::GrantFlow)
Doorkeeper::GrantFlow.register(
:id_token,
response_type_matches: 'id_token',
response_mode_matches: %w[fragment form_post],
response_type_strategy: Doorkeeper::OpenidConnect::IdToken,
)
Doorkeeper::GrantFlow.register(
:id_token,
response_type_matches: 'id_token',
response_mode_matches: %w[fragment form_post],
response_type_strategy: Doorkeeper::OpenidConnect::IdToken,
)

Doorkeeper::GrantFlow.register(
'id_token token',
response_type_matches: 'id_token token',
response_mode_matches: %w[fragment form_post],
response_type_strategy: Doorkeeper::OpenidConnect::IdTokenToken,
)
Doorkeeper::GrantFlow.register(
'id_token token',
response_type_matches: 'id_token token',
response_mode_matches: %w[fragment form_post],
response_type_strategy: Doorkeeper::OpenidConnect::IdTokenToken,
)

Doorkeeper::GrantFlow.register_alias(
'implicit_oidc', as: ['implicit', 'id_token', 'id_token token']
)
else
# TODO: drop this and corresponding file when we will set minimal
# required Doorkeeper version to 5.5.
Doorkeeper::Config.prepend OpenidConnect::ResponseTypeConfig
end
Doorkeeper::GrantFlow.register_alias(
'implicit_oidc', as: ['implicit', 'id_token', 'id_token token']
)
end
end
17 changes: 0 additions & 17 deletions lib/doorkeeper/openid_connect/response_types_config.rb

This file was deleted.

0 comments on commit 99ef25e

Please sign in to comment.