doorkeeper 5.4.0 → 5.5.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of doorkeeper might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +71 -10
- data/README.md +10 -4
- data/app/controllers/doorkeeper/application_controller.rb +1 -0
- data/app/controllers/doorkeeper/authorizations_controller.rb +16 -5
- data/app/controllers/doorkeeper/authorized_applications_controller.rb +1 -1
- data/app/controllers/doorkeeper/token_info_controller.rb +12 -2
- data/app/controllers/doorkeeper/tokens_controller.rb +34 -26
- data/app/views/doorkeeper/applications/show.html.erb +16 -12
- data/app/views/doorkeeper/authorizations/form_post.html.erb +15 -0
- data/app/views/doorkeeper/authorizations/new.html.erb +2 -0
- data/config/locales/en.yml +3 -1
- data/lib/doorkeeper.rb +5 -0
- data/lib/doorkeeper/config.rb +92 -63
- data/lib/doorkeeper/config/option.rb +1 -3
- data/lib/doorkeeper/config/validations.rb +53 -0
- data/lib/doorkeeper/grant_flow.rb +45 -0
- data/lib/doorkeeper/grant_flow/fallback_flow.rb +15 -0
- data/lib/doorkeeper/grant_flow/flow.rb +44 -0
- data/lib/doorkeeper/grant_flow/registry.rb +50 -0
- data/lib/doorkeeper/helpers/controller.rb +4 -0
- data/lib/doorkeeper/models/access_grant_mixin.rb +1 -2
- data/lib/doorkeeper/models/access_token_mixin.rb +4 -4
- data/lib/doorkeeper/models/concerns/expirable.rb +1 -1
- data/lib/doorkeeper/models/concerns/revocable.rb +1 -1
- data/lib/doorkeeper/oauth/authorization/code.rb +4 -0
- data/lib/doorkeeper/oauth/authorization/context.rb +5 -5
- data/lib/doorkeeper/oauth/authorization/token.rb +10 -4
- data/lib/doorkeeper/oauth/authorization/uri_builder.rb +1 -1
- data/lib/doorkeeper/oauth/authorization_code_request.rb +10 -17
- data/lib/doorkeeper/oauth/base_request.rb +1 -1
- data/lib/doorkeeper/oauth/client_credentials/creator.rb +2 -1
- data/lib/doorkeeper/oauth/client_credentials/issuer.rb +1 -0
- data/lib/doorkeeper/oauth/code_request.rb +1 -1
- data/lib/doorkeeper/oauth/code_response.rb +17 -11
- data/lib/doorkeeper/oauth/error_response.rb +4 -3
- data/lib/doorkeeper/oauth/helpers/scope_checker.rb +1 -3
- data/lib/doorkeeper/oauth/helpers/uri_checker.rb +0 -18
- data/lib/doorkeeper/oauth/password_access_token_request.rb +23 -3
- data/lib/doorkeeper/oauth/pre_authorization.rb +33 -8
- data/lib/doorkeeper/oauth/refresh_token_request.rb +13 -0
- data/lib/doorkeeper/orm/active_record.rb +5 -14
- data/lib/doorkeeper/orm/active_record/mixins/access_grant.rb +11 -1
- data/lib/doorkeeper/orm/active_record/mixins/access_token.rb +9 -1
- data/lib/doorkeeper/orm/active_record/mixins/application.rb +15 -4
- data/lib/doorkeeper/orm/active_record/redirect_uri_validator.rb +5 -0
- data/lib/doorkeeper/rails/routes.rb +1 -3
- data/lib/doorkeeper/rake/db.rake +3 -3
- data/lib/doorkeeper/rake/setup.rake +5 -0
- data/lib/doorkeeper/request.rb +49 -12
- data/lib/doorkeeper/request/password.rb +1 -0
- data/lib/doorkeeper/version.rb +2 -6
- data/lib/generators/doorkeeper/templates/add_owner_to_application_migration.rb.erb +1 -1
- data/lib/generators/doorkeeper/templates/initializer.rb +10 -8
- metadata +23 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b8f700b4b7e5e40df07c8679ec477db21fe96ed05d70a5e6cb50c62cac886c2
|
4
|
+
data.tar.gz: cc34f22bd2800620f9b901a0025f569a0299a1105a7350ba95b62b34b7f5cdad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27d0ae20071180742cb735351165d808d8d3a6f0571ce12fc741f572fb9f69c789d760c299fa5a31814790611474e3eed12fb2a8ab4902151c21a847855fa8d3
|
7
|
+
data.tar.gz: 64e39c64aa61cf27ee0418be14880b9bb1ce23159a6ee61af4d32b1a187ddcb32f70402799bb9f673a1d3a1efe1abd2e9b940564d05e161a7aee737497af1d54
|
data/CHANGELOG.md
CHANGED
@@ -5,9 +5,70 @@ upgrade guides.
|
|
5
5
|
|
6
6
|
User-visible changes worth mentioning.
|
7
7
|
|
8
|
-
##
|
8
|
+
## main
|
9
9
|
|
10
|
-
- [#PR ID]
|
10
|
+
- [#PR ID] Add your PR description here.
|
11
|
+
|
12
|
+
## 5.5.2
|
13
|
+
|
14
|
+
- [#1502] Drop support for Ruby 2.4 because of EOL.
|
15
|
+
- [#1504] Updated the url fragment in the comment for code documentation.
|
16
|
+
- [#1512] Fix form behavior when response mode is form_post.
|
17
|
+
- [#1511] Fix that authorization code is returned by fragment if response_mode is fragament.
|
18
|
+
|
19
|
+
## 5.5.1
|
20
|
+
|
21
|
+
- [#1496] Revoke `old_refresh_token` if `previous_refresh_token` is present.
|
22
|
+
- [#1495] Fix `respond_to` undefined in API-only mode
|
23
|
+
- [#1488] Verify client authentication for Resource Owner Password Grant when
|
24
|
+
`config.skip_client_authentication_for_password_grant` is set and the client credentials
|
25
|
+
are sent in a HTTP Basic auth header.
|
26
|
+
|
27
|
+
## 5.5.0
|
28
|
+
|
29
|
+
- [#1482] Simplify `TokenInfoController` to be overridable (extract response rendering).
|
30
|
+
- [#1478] Fix ownership association and Rake tasks when custom models configured.
|
31
|
+
- [#1477] Respect `ActiveRecord::Base.pluralize_table_names` for Doorkeeper table names.
|
32
|
+
|
33
|
+
## 5.5.0.rc2
|
34
|
+
|
35
|
+
- [#1473] Enable `Applications` and `AuthorizedApplications` controllers in API mode.
|
36
|
+
|
37
|
+
**[IMPORTANT]** you can still skip these controllers using `skip_controllers` in
|
38
|
+
`use_doorkeeper` inside `routes.rb`. Please do it in case you don't need them.
|
39
|
+
|
40
|
+
- [#1472] Fix `establish_connection` configuration for custom defined models.
|
41
|
+
- [#1471] Add support for Ruby 3.0.
|
42
|
+
- [#1469] Check if `redirect_uri` exists.
|
43
|
+
- [#1465] Memoize nil doorkeeper_token.
|
44
|
+
- [#1459] Use built-in Ruby option to remove padding in PKCE code challenge value.
|
45
|
+
- [#1457] Make owner_id a bigint for newly-generated owner migrations
|
46
|
+
- [#1452] Empty previous_refresh_token only if present.
|
47
|
+
- [#1440] Validate empty host in redirect_uri.
|
48
|
+
- [#1438] Add form post response mode.
|
49
|
+
- [#1458] Make `config.skip_client_authentication_for_password_grant` a long term configuration option.
|
50
|
+
|
51
|
+
## 5.5.0.rc1
|
52
|
+
|
53
|
+
- [#1435] Make error response not redirectable when client is unauthorized
|
54
|
+
- [#1426] Ensure ActiveRecord callbacks are executed on token revocation.
|
55
|
+
- [#1407] Remove redundant and complex to support helpers froms tests (`should_have_json`, etc).
|
56
|
+
- [#1416] Don't add introspection route if token introspection completely disabled.
|
57
|
+
- [#1410] Properly memoize `current_resource_owner` value (consider `nil` and `false` values).
|
58
|
+
- [#1415] Ignore PKCE params for non-PKCE grants.
|
59
|
+
- [#1418] Add ability to register custom OAuth Grant Flows.
|
60
|
+
- [#1420] Require client authentication for Resource Owner Password Grant as stated in OAuth RFC.
|
61
|
+
|
62
|
+
**[IMPORTANT]** you need to create a new OAuth client (`Doorkeeper::Application`) if you didn't
|
63
|
+
have it before and use client credentials in HTTP Basic auth if you previously used this grant
|
64
|
+
flow without client authentication. To opt out of this you could set the
|
65
|
+
`skip_client_authentication_for_password_grant` configuration option to `true`, but note that
|
66
|
+
this is in violation of the OAuth spec and represents a security risk.
|
67
|
+
All the users of your provider application now need to include client credentials when they use
|
68
|
+
this grant flow.
|
69
|
+
|
70
|
+
- [#1421] Add Resource Owner instance to authorization hook context for `custom_access_token_expires_in`
|
71
|
+
configuration option to allow resource owner based Access Tokens TTL.
|
11
72
|
|
12
73
|
## 5.4.0
|
13
74
|
|
@@ -17,7 +78,7 @@ User-visible changes worth mentioning.
|
|
17
78
|
|
18
79
|
- [#1371] Add `#as_json` method and attributes serialization restriction for Application model.
|
19
80
|
Fixes information disclosure vulnerability (CVE-2020-10187).
|
20
|
-
|
81
|
+
|
21
82
|
**[IMPORTANT]** you need to re-implement `#as_json` method for Doorkeeper Application model
|
22
83
|
if you previously used `#to_json` serialization with custom options or attributes or rely on
|
23
84
|
JSON response from /oauth/applications.json or /oauth/authorized_applications.json. This change
|
@@ -31,17 +92,17 @@ User-visible changes worth mentioning.
|
|
31
92
|
- [#1402] Handle trying authorization with client credentials.
|
32
93
|
|
33
94
|
## 5.4.0.rc1
|
34
|
-
- [#1366] Sets expiry of token generated using `refresh_token` to that of original token. (Fixes #1364)
|
95
|
+
- [#1366] Sets expiry of token generated using `refresh_token` to that of original token. (Fixes #1364)
|
35
96
|
- [#1354] Add `authorize_resource_owner_for_client` option to authorize the calling user to access an application.
|
36
97
|
- [#1355] Allow to enable polymorphic Resource Owner association for Access Token & Grant
|
37
98
|
models (`use_polymorphic_resource_owner` configuration option).
|
38
|
-
|
99
|
+
|
39
100
|
**[IMPORTANT]** Review your custom patches or extensions for Doorkeeper internals if you
|
40
101
|
have such - since now Doorkeeper passes Resource Owner instance to every objects and not
|
41
102
|
just it's ID. See PR description for details.
|
42
|
-
|
103
|
+
|
43
104
|
- [#1356] Remove duplicated scopes from Access Tokens and Grants on attribute assignment.
|
44
|
-
- [#1357] Fix `Doorkeeper::OAuth::PreAuthorization#as_json` method causing
|
105
|
+
- [#1357] Fix `Doorkeeper::OAuth::PreAuthorization#as_json` method causing
|
45
106
|
`Stack level too deep` error with AMS (fix #1312).
|
46
107
|
- [#1358] Deprecate `active_record_options` configuration option.
|
47
108
|
- [#1359] Refactor Doorkeeper configuration options DSL to make it easy to reuse it
|
@@ -53,7 +114,7 @@ User-visible changes worth mentioning.
|
|
53
114
|
**[IMPORTANT]** now fully according to RFC 7009 nobody can do a revocation request without `client_id`
|
54
115
|
(for public clients) and `client_secret` (for private clients). Please update your apps to include that
|
55
116
|
info in the revocation request payload.
|
56
|
-
|
117
|
+
|
57
118
|
- [#1373] Make Doorkeeper routes mapper reusable in extensions.
|
58
119
|
- [#1374] Revoke and issue client credentials token in a transaction with a row lock.
|
59
120
|
- [#1384] Add context object with auth/pre_auth and issued_token for authorization hooks.
|
@@ -98,9 +159,9 @@ User-visible changes worth mentioning.
|
|
98
159
|
|
99
160
|
- [#1371] Backport: add `#as_json` method and attributes serialization restriction for Application model.
|
100
161
|
Fixes information disclosure vulnerability (CVE-2020-10187).
|
101
|
-
|
162
|
+
|
102
163
|
## 5.2.4
|
103
|
-
|
164
|
+
|
104
165
|
- [#1360] Backport: Increase `matching_token_for` batch lookup size to 10 000 and make it configurable.
|
105
166
|
|
106
167
|
## 5.2.3
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Doorkeeper — awesome OAuth 2 provider for your Rails / Grape app.
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/doorkeeper.svg)](https://rubygems.org/gems/doorkeeper)
|
4
|
-
[![Build Status](https://travis-ci.org/doorkeeper-gem/doorkeeper.svg?branch=
|
4
|
+
[![Build Status](https://travis-ci.org/doorkeeper-gem/doorkeeper.svg?branch=main)](https://travis-ci.org/doorkeeper-gem/doorkeeper)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/doorkeeper-gem/doorkeeper.svg)](https://codeclimate.com/github/doorkeeper-gem/doorkeeper)
|
6
|
-
[![Coverage Status](https://coveralls.io/repos/github/doorkeeper-gem/doorkeeper/badge.svg?branch=
|
7
|
-
[![Security](https://hakiri.io/github/doorkeeper-gem/doorkeeper/
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/github/doorkeeper-gem/doorkeeper/badge.svg?branch=main)](https://coveralls.io/github/doorkeeper-gem/doorkeeper?branch=main)
|
7
|
+
[![Security](https://hakiri.io/github/doorkeeper-gem/doorkeeper/main.svg)](https://hakiri.io/github/doorkeeper-gem/doorkeeper/main)
|
8
8
|
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
|
9
9
|
[![GuardRails badge](https://badges.guardrails.io/doorkeeper-gem/doorkeeper.svg?token=66768ce8f6995814df81f65a2cff40f739f688492704f973e62809e15599bb62)](https://dashboard.guardrails.io/default/gh/doorkeeper-gem/doorkeeper)
|
10
10
|
[![Dependabot](https://img.shields.io/badge/dependabot-enabled-success.svg)](https://dependabot.com)
|
@@ -51,7 +51,7 @@ Supported features:
|
|
51
51
|
|
52
52
|
## Documentation
|
53
53
|
|
54
|
-
This documentation is valid for `
|
54
|
+
This documentation is valid for `main` branch. Please check the documentation for the version of doorkeeper you are using in:
|
55
55
|
https://github.com/doorkeeper-gem/doorkeeper/releases.
|
56
56
|
|
57
57
|
Additionally, other resources can be found on:
|
@@ -134,6 +134,12 @@ See [list of tutorials](https://github.com/doorkeeper-gem/doorkeeper/wiki#how-to
|
|
134
134
|
|
135
135
|
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/doorkeeper-gem#sponsor)]
|
136
136
|
|
137
|
+
<a href="https://codecademy.com/about/careers?utm_source=doorkeeper-gem" target="_blank"><img src="https://static-assets.codecademy.com/marketing/codecademy_logo_padded.png"/></a>
|
138
|
+
|
139
|
+
> Codecademy supports open source as part of its mission to democratize tech. Come help us build the education the world deserves: [https://codecademy.com/about/careers](https://codecademy.com/about/careers?utm_source=doorkeeper-gem)
|
140
|
+
|
141
|
+
<br>
|
142
|
+
|
137
143
|
<a href="https://oauth.io/?utm_source=doorkeeper-gem" target="_blank"><img src="https://oauth.io/img/logo_text.png"/></a>
|
138
144
|
|
139
145
|
> If you prefer not to deal with the gory details of OAuth 2, need dedicated customer support & consulting, try the cloud-based SaaS version: [https://oauth.io](https://oauth.io/?utm_source=doorkeeper-gem)
|
@@ -4,6 +4,7 @@ module Doorkeeper
|
|
4
4
|
class ApplicationController <
|
5
5
|
Doorkeeper.config.resolve_controller(:base)
|
6
6
|
include Helpers::Controller
|
7
|
+
include ActionController::MimeResponds if Doorkeeper.config.api_only
|
7
8
|
|
8
9
|
unless Doorkeeper.config.api_only
|
9
10
|
protect_from_forgery with: :exception
|
@@ -52,10 +52,19 @@ module Doorkeeper
|
|
52
52
|
def redirect_or_render(auth)
|
53
53
|
if auth.redirectable?
|
54
54
|
if Doorkeeper.configuration.api_only
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
if pre_auth.form_post_response?
|
56
|
+
render(
|
57
|
+
json: { status: :post, redirect_uri: pre_auth.redirect_uri, body: auth.body },
|
58
|
+
status: auth.status,
|
59
|
+
)
|
60
|
+
else
|
61
|
+
render(
|
62
|
+
json: { status: :redirect, redirect_uri: auth.redirect_uri },
|
63
|
+
status: auth.status,
|
64
|
+
)
|
65
|
+
end
|
66
|
+
elsif pre_auth.form_post_response?
|
67
|
+
render :form_post
|
59
68
|
else
|
60
69
|
redirect_to auth.redirect_uri
|
61
70
|
end
|
@@ -82,8 +91,10 @@ module Doorkeeper
|
|
82
91
|
code_challenge
|
83
92
|
code_challenge_method
|
84
93
|
response_type
|
94
|
+
response_mode
|
85
95
|
redirect_uri
|
86
|
-
scope
|
96
|
+
scope
|
97
|
+
state
|
87
98
|
]
|
88
99
|
end
|
89
100
|
|
@@ -4,12 +4,22 @@ module Doorkeeper
|
|
4
4
|
class TokenInfoController < Doorkeeper::ApplicationMetalController
|
5
5
|
def show
|
6
6
|
if doorkeeper_token&.accessible?
|
7
|
-
render json:
|
7
|
+
render json: doorkeeper_token_to_json, status: :ok
|
8
8
|
else
|
9
9
|
error = OAuth::InvalidTokenResponse.new
|
10
10
|
response.headers.merge!(error.headers)
|
11
|
-
render json: error
|
11
|
+
render json: error_to_json(error), status: error.status
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
def doorkeeper_token_to_json
|
18
|
+
doorkeeper_token
|
19
|
+
end
|
20
|
+
|
21
|
+
def error_to_json(error)
|
22
|
+
error.body
|
23
|
+
end
|
14
24
|
end
|
15
25
|
end
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module Doorkeeper
|
4
4
|
class TokensController < Doorkeeper::ApplicationMetalController
|
5
|
+
before_action :validate_presence_of_client, only: [:revoke]
|
6
|
+
|
5
7
|
def create
|
6
8
|
headers.merge!(authorize_response.headers)
|
7
9
|
render json: authorize_response.body,
|
@@ -12,32 +14,6 @@ module Doorkeeper
|
|
12
14
|
|
13
15
|
# OAuth 2.0 Token Revocation - http://tools.ietf.org/html/rfc7009
|
14
16
|
def revoke
|
15
|
-
# @see 2.1. Revocation Request
|
16
|
-
#
|
17
|
-
# The client constructs the request by including the following
|
18
|
-
# parameters using the "application/x-www-form-urlencoded" format in
|
19
|
-
# the HTTP request entity-body:
|
20
|
-
# token REQUIRED.
|
21
|
-
# token_type_hint OPTIONAL.
|
22
|
-
#
|
23
|
-
# The client also includes its authentication credentials as described
|
24
|
-
# in Section 2.3. of [RFC6749].
|
25
|
-
#
|
26
|
-
# The authorization server first validates the client credentials (in
|
27
|
-
# case of a confidential client) and then verifies whether the token
|
28
|
-
# was issued to the client making the revocation request.
|
29
|
-
unless server.client
|
30
|
-
# If this validation [client credentials / token ownership] fails, the request is
|
31
|
-
# refused and the client is informed of the error by the authorization server as
|
32
|
-
# described below.
|
33
|
-
#
|
34
|
-
# @see 2.2.1. Error Response
|
35
|
-
#
|
36
|
-
# The error presentation conforms to the definition in Section 5.2 of [RFC6749].
|
37
|
-
render json: revocation_error_response, status: :forbidden
|
38
|
-
return
|
39
|
-
end
|
40
|
-
|
41
17
|
# The authorization server responds with HTTP status code 200 if the client
|
42
18
|
# submitted an invalid token or the token has been revoked successfully.
|
43
19
|
if token.blank?
|
@@ -68,7 +44,39 @@ module Doorkeeper
|
|
68
44
|
|
69
45
|
private
|
70
46
|
|
47
|
+
def validate_presence_of_client
|
48
|
+
return if Doorkeeper.config.skip_client_authentication_for_password_grant
|
49
|
+
|
50
|
+
# @see 2.1. Revocation Request
|
51
|
+
#
|
52
|
+
# The client constructs the request by including the following
|
53
|
+
# parameters using the "application/x-www-form-urlencoded" format in
|
54
|
+
# the HTTP request entity-body:
|
55
|
+
# token REQUIRED.
|
56
|
+
# token_type_hint OPTIONAL.
|
57
|
+
#
|
58
|
+
# The client also includes its authentication credentials as described
|
59
|
+
# in Section 2.3. of [RFC6749].
|
60
|
+
#
|
61
|
+
# The authorization server first validates the client credentials (in
|
62
|
+
# case of a confidential client) and then verifies whether the token
|
63
|
+
# was issued to the client making the revocation request.
|
64
|
+
return if server.client
|
65
|
+
|
66
|
+
# If this validation [client credentials / token ownership] fails, the request is
|
67
|
+
# refused and the client is informed of the error by the authorization server as
|
68
|
+
# described below.
|
69
|
+
#
|
70
|
+
# @see 2.2.1. Error Response
|
71
|
+
#
|
72
|
+
# The error presentation conforms to the definition in Section 5.2 of [RFC6749].
|
73
|
+
render json: revocation_error_response, status: :forbidden
|
74
|
+
end
|
75
|
+
|
71
76
|
# OAuth 2.0 Section 2.1 defines two client types, "public" & "confidential".
|
77
|
+
#
|
78
|
+
# RFC7009
|
79
|
+
# Section 5. Security Considerations
|
72
80
|
# A malicious client may attempt to guess valid tokens on this endpoint
|
73
81
|
# by making revocation requests against potential token strings.
|
74
82
|
# According to this specification, a client's request must contain a
|
@@ -35,18 +35,22 @@
|
|
35
35
|
|
36
36
|
<h4><%= t('.callback_urls') %>:</h4>
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
<
|
42
|
-
<
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
38
|
+
<% if @application.redirect_uri.present? %>
|
39
|
+
<table>
|
40
|
+
<% @application.redirect_uri.split.each do |uri| %>
|
41
|
+
<tr>
|
42
|
+
<td>
|
43
|
+
<code class="bg-light"><%= uri %></code>
|
44
|
+
</td>
|
45
|
+
<td>
|
46
|
+
<%= link_to t('doorkeeper.applications.buttons.authorize'), oauth_authorization_path(client_id: @application.uid, redirect_uri: uri, response_type: 'code', scope: @application.scopes), class: 'btn btn-success', target: '_blank' %>
|
47
|
+
</td>
|
48
|
+
</tr>
|
49
|
+
<% end %>
|
50
|
+
</table>
|
51
|
+
<% else %>
|
52
|
+
<span class="bg-light font-italic text-uppercase text-muted"><%= t('.not_defined') %></span>
|
53
|
+
<% end %>
|
50
54
|
</div>
|
51
55
|
|
52
56
|
<div class="col-md-4">
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<header class="page-header">
|
2
|
+
<h1><%= t('.title') %></h1>
|
3
|
+
</header>
|
4
|
+
|
5
|
+
<%= form_tag @pre_auth.redirect_uri, method: :post, name: :redirect_form, authenticity_token: false do %>
|
6
|
+
<% @authorize_response.body.compact.each do |key, value| %>
|
7
|
+
<%= hidden_field_tag key, value %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<script>
|
12
|
+
window.onload = function () {
|
13
|
+
document.forms['redirect_form'].submit();
|
14
|
+
};
|
15
|
+
</script>
|
@@ -25,6 +25,7 @@
|
|
25
25
|
<%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
|
26
26
|
<%= hidden_field_tag :state, @pre_auth.state %>
|
27
27
|
<%= hidden_field_tag :response_type, @pre_auth.response_type %>
|
28
|
+
<%= hidden_field_tag :response_mode, @pre_auth.response_mode %>
|
28
29
|
<%= hidden_field_tag :scope, @pre_auth.scope %>
|
29
30
|
<%= hidden_field_tag :code_challenge, @pre_auth.code_challenge %>
|
30
31
|
<%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
|
@@ -35,6 +36,7 @@
|
|
35
36
|
<%= hidden_field_tag :redirect_uri, @pre_auth.redirect_uri %>
|
36
37
|
<%= hidden_field_tag :state, @pre_auth.state %>
|
37
38
|
<%= hidden_field_tag :response_type, @pre_auth.response_type %>
|
39
|
+
<%= hidden_field_tag :response_mode, @pre_auth.response_mode %>
|
38
40
|
<%= hidden_field_tag :scope, @pre_auth.scope %>
|
39
41
|
<%= hidden_field_tag :code_challenge, @pre_auth.code_challenge %>
|
40
42
|
<%= hidden_field_tag :code_challenge_method, @pre_auth.code_challenge_method %>
|
data/config/locales/en.yml
CHANGED
@@ -72,6 +72,8 @@ en:
|
|
72
72
|
able_to: 'This application will be able to'
|
73
73
|
show:
|
74
74
|
title: 'Authorization code'
|
75
|
+
form_post:
|
76
|
+
title: 'Submit this form'
|
75
77
|
|
76
78
|
authorized_applications:
|
77
79
|
confirmations:
|
@@ -93,7 +95,6 @@ en:
|
|
93
95
|
invalid_request:
|
94
96
|
unknown: 'The request is missing a required parameter, includes an unsupported parameter value, or is otherwise malformed.'
|
95
97
|
missing_param: 'Missing required parameter: %{value}.'
|
96
|
-
not_support_pkce: 'Invalid code_verifier parameter. Server does not support pkce.'
|
97
98
|
request_not_authorized: 'Request need to be authorized. Required parameter for authorizing request is missing or invalid.'
|
98
99
|
invalid_redirect_uri: "The requested redirect uri is malformed or doesn't match client redirect URI."
|
99
100
|
unauthorized_client: 'The client is not authorized to perform this request using this method.'
|
@@ -110,6 +111,7 @@ en:
|
|
110
111
|
|
111
112
|
# Access grant errors
|
112
113
|
unsupported_response_type: 'The authorization server does not support this response type.'
|
114
|
+
unsupported_response_mode: 'The authorization server does not support this response mode.'
|
113
115
|
|
114
116
|
# Access token errors
|
115
117
|
invalid_client: 'Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.'
|
data/lib/doorkeeper.rb
CHANGED
@@ -7,6 +7,7 @@ require "doorkeeper/engine"
|
|
7
7
|
#
|
8
8
|
module Doorkeeper
|
9
9
|
autoload :Errors, "doorkeeper/errors"
|
10
|
+
autoload :GrantFlow, "doorkeeper/grant_flow"
|
10
11
|
autoload :OAuth, "doorkeeper/oauth"
|
11
12
|
autoload :Rake, "doorkeeper/rake"
|
12
13
|
autoload :Request, "doorkeeper/request"
|
@@ -114,4 +115,8 @@ module Doorkeeper
|
|
114
115
|
def self.authenticate(request, methods = Doorkeeper.config.access_token_methods)
|
115
116
|
OAuth::Token.authenticate(request, *methods)
|
116
117
|
end
|
118
|
+
|
119
|
+
def self.gem_version
|
120
|
+
::Gem::Version.new(::Doorkeeper::VERSION::STRING)
|
121
|
+
end
|
117
122
|
end
|