oauth2 2.0.4 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -1
- data/README.md +11 -3
- data/lib/oauth2/access_token.rb +30 -10
- data/lib/oauth2/client.rb +44 -21
- data/lib/oauth2/error.rb +17 -9
- data/lib/oauth2/strategy/assertion.rb +1 -1
- data/lib/oauth2/strategy/auth_code.rb +1 -1
- data/lib/oauth2/strategy/client_credentials.rb +1 -1
- data/lib/oauth2/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9943fbd1a1592461b1397edb9ac16faf301da6ac1c8a2f9e441218c1a51924
|
4
|
+
data.tar.gz: 4435312a9b4cc0392dc49a15f9f71e8a1ed3ff3ca71ba6a7fbaf480aeede052a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82997d8c41529574701ef25565735fe46d7e343689e5cc07f93cd9bcb074aaa78370aa50062aa59adcfa078f432fb9d2b7ada58d17fae4ac3874a51843e881d6
|
7
|
+
data.tar.gz: c3ce8c8fec91b43a570392791bcab65ccf0b4e4051e3ad6c726c0d23575ae7caf600adbf2a07c27eb1363be6aa9d5019c3adb34d7c166cd5e2c9ae411af9aac9
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format (since v2) is based on [Keep a Changelog v1](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [2.0.7] - 2022-08-22
|
8
|
+
### Added
|
9
|
+
- [#629](https://github.com/oauth-xx/oauth2/pull/629) - Allow POST of JSON to get token (@pboling, @terracatta)
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- [#626](https://github.com/oauth-xx/oauth2/pull/626) - Fixes a regression in 2.0.6. Will now prefer the key order from the lookup, not the hash keys (@rickselby)
|
13
|
+
- Note: This fixes compatibility with `omniauth-oauth2` and AWS
|
14
|
+
- [#625](https://github.com/oauth-xx/oauth2/pull/625) - Fixes the printed version in the post install message (@hasghari)
|
15
|
+
|
16
|
+
## [2.0.6] - 2022-07-13
|
17
|
+
### Fixed
|
18
|
+
- [#624](https://github.com/oauth-xx/oauth2/pull/624) - Fixes a [regression](https://github.com/oauth-xx/oauth2/pull/623) in v2.0.5, where an error would be raised in refresh_token flows due to (legitimate) lack of access_token (@pboling)
|
19
|
+
|
20
|
+
## [2.0.5] - 2022-07-07
|
21
|
+
### Fixed
|
22
|
+
- [#620](https://github.com/oauth-xx/oauth2/pull/620) - Documentation improvements, to help with upgrading (@swanson)
|
23
|
+
- [#621](https://github.com/oauth-xx/oauth2/pull/621) - Fixed [#528](https://github.com/oauth-xx/oauth2/issues/528) and [#619](https://github.com/oauth-xx/oauth2/issues/619) (@pboling)
|
24
|
+
- All data in responses is now returned, with the access token removed and set as `token`
|
25
|
+
- `refresh_token` is no longer dropped
|
26
|
+
- **BREAKING**: Microsoft's `id_token` is no longer left as `access_token['id_token']`, but moved to the standard `access_token.token` that all other strategies use
|
27
|
+
- Remove `parse` and `snaky` from options so they don't get included in response
|
28
|
+
- There is now 100% test coverage, for lines _and_ branches, and it will stay that way.
|
29
|
+
|
7
30
|
## [2.0.4] - 2022-07-01
|
8
31
|
### Fixed
|
9
32
|
- [#618](https://github.com/oauth-xx/oauth2/pull/618) - In some scenarios the `snaky` option default value was not applied (@pboling)
|
@@ -65,6 +88,10 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
|
|
65
88
|
- [#414](https://github.com/oauth-xx/oauth2/pull/414) - Use Base64.strict_encode64 instead of custom internal logic (@meganemura)
|
66
89
|
- [#489](https://github.com/oauth-xx/oauth2/pull/489) - **BREAKING**: Default value for option `OAuth2::Client` - `:authorize_url` removed leading slash to work with relative paths by default (`'oauth/authorize'`) (@ghost)
|
67
90
|
- [#489](https://github.com/oauth-xx/oauth2/pull/489) - **BREAKING**: Default value for option `OAuth2::Client` - `:token_url` removed leading slash to work with relative paths by default (`'oauth/token'`) (@ghost)
|
91
|
+
- [#507](https://github.com/oauth-xx/oauth2/pull/507), [#575](https://github.com/oauth-xx/oauth2/pull/575) - **BREAKING**: Transform keys to camel case, always, by default (ultimately via `rash_alt` gem)
|
92
|
+
- Original keys will still work as previously, in most scenarios, thanks to `rash_alt` gem.
|
93
|
+
- However, this is a _breaking_ change if you rely on `response.parsed.to_h`, as the keys in the result will be camel case.
|
94
|
+
- As of version 2.0.4 you can turn key transformation off with the `snaky: false` option.
|
68
95
|
- [#576](https://github.com/oauth-xx/oauth2/pull/576) - **BREAKING**: Stop rescuing parsing errors (@pboling)
|
69
96
|
- [#591](https://github.com/oauth-xx/oauth2/pull/576) - _DEPRECATION_: `OAuth2::Client` - `:extract_access_token` option is deprecated
|
70
97
|
### Fixed
|
@@ -277,5 +304,7 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
|
|
277
304
|
[2.0.2]: https://github.com/oauth-xx/oauth2/compare/v2.0.1...v2.0.2
|
278
305
|
[2.0.3]: https://github.com/oauth-xx/oauth2/compare/v2.0.2...v2.0.3
|
279
306
|
[2.0.4]: https://github.com/oauth-xx/oauth2/compare/v2.0.3...v2.0.4
|
280
|
-
[
|
307
|
+
[2.0.5]: https://github.com/oauth-xx/oauth2/compare/v2.0.4...v2.0.5
|
308
|
+
[2.0.6]: https://github.com/oauth-xx/oauth2/compare/v2.0.5...v2.0.6
|
309
|
+
[Unreleased]: https://github.com/oauth-xx/oauth2/compare/v2.0.6...HEAD
|
281
310
|
[gemfiles/readme]: gemfiles/README.md
|
data/README.md
CHANGED
@@ -32,6 +32,8 @@ See the sibling `oauth` gem for OAuth 1.0 implementations in Ruby.
|
|
32
32
|
|
33
33
|
| Version | Release Date | Readme |
|
34
34
|
|---------|--------------|----------------------------------------------------------|
|
35
|
+
| 2.0.6 | 2022-07-13 | https://github.com/oauth-xx/oauth2/blob/v2.0.6/README.md |
|
36
|
+
| 2.0.5 | 2022-07-07 | https://github.com/oauth-xx/oauth2/blob/v2.0.5/README.md |
|
35
37
|
| 2.0.4 | 2022-07-01 | https://github.com/oauth-xx/oauth2/blob/v2.0.4/README.md |
|
36
38
|
| 2.0.3 | 2022-06-28 | https://github.com/oauth-xx/oauth2/blob/v2.0.3/README.md |
|
37
39
|
| 2.0.2 | 2022-06-24 | https://github.com/oauth-xx/oauth2/blob/v2.0.2/README.md |
|
@@ -143,8 +145,8 @@ The link tokens in the following sections should be kept ordered by the row and
|
|
143
145
|
[🖐prs-o-img]: https://img.shields.io/github/issues-pr/oauth-xx/oauth2
|
144
146
|
[🧮prs-c]: https://github.com/oauth-xx/oauth2/pulls?q=is%3Apr+is%3Aclosed
|
145
147
|
[🧮prs-c-img]: https://img.shields.io/github/issues-pr-closed/oauth-xx/oauth2
|
146
|
-
[📗next♻️]: https://github.com/oauth-xx/oauth2/milestone/
|
147
|
-
[📗next-img♻️]: https://img.shields.io/github/milestones/progress/oauth-xx/oauth2/
|
148
|
+
[📗next♻️]: https://github.com/oauth-xx/oauth2/milestone/2
|
149
|
+
[📗next-img♻️]: https://img.shields.io/github/milestones/progress/oauth-xx/oauth2/2?label=Next%20Version
|
148
150
|
|
149
151
|
<!-- 3️⃣ maintenance & linting -->
|
150
152
|
[⛳cclim-maint]: https://codeclimate.com/github/oauth-xx/oauth2/maintainability
|
@@ -257,6 +259,12 @@ For more see [SECURITY.md][🚎sec-pol].
|
|
257
259
|
- `:access_token_class` (`AccessToken`); user specified class to use for all calls to `get_token`
|
258
260
|
- Adds new option to `OAuth2::AccessToken#initialize`:
|
259
261
|
- `:expires_latency` (`nil`); number of seconds by which AccessToken validity will be reduced to offset latency
|
262
|
+
- By default, keys are transformed to camel case.
|
263
|
+
- Original keys will still work as previously, in most scenarios, thanks to `rash_alt` gem.
|
264
|
+
- However, this is a _breaking_ change if you rely on `response.parsed.to_h`, as the keys in the result will be camel case.
|
265
|
+
- As of version 2.0.4 you can turn key transformation off with the `snaky: false` option.
|
266
|
+
- By default, the `:auth_scheme` is now `:basic_auth` (instead of `:request_body`)
|
267
|
+
- Third-party strategies and gems may need to be updated if a provider was requiring client id/secret in the request body
|
260
268
|
- [... A lot more](https://github.com/oauth-xx/oauth2/blob/master/CHANGELOG.md#2.0.0)
|
261
269
|
|
262
270
|
## Compatibility
|
@@ -517,7 +525,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
517
525
|
|
518
526
|
See [CONTRIBUTING.md][contributing]
|
519
527
|
|
520
|
-
[contributing]: https://github.com/oauth-xx/oauth2/blob/
|
528
|
+
[contributing]: https://github.com/oauth-xx/oauth2/blob/master/CONTRIBUTING.md
|
521
529
|
|
522
530
|
## Contributors
|
523
531
|
|
data/lib/oauth2/access_token.rb
CHANGED
@@ -2,18 +2,28 @@
|
|
2
2
|
|
3
3
|
module OAuth2
|
4
4
|
class AccessToken # rubocop:disable Metrics/ClassLength
|
5
|
+
TOKEN_KEYS_STR = %w[access_token id_token token accessToken idToken].freeze
|
6
|
+
TOKEN_KEYS_SYM = %i[access_token id_token token accessToken idToken].freeze
|
7
|
+
TOKEN_KEY_LOOKUP = TOKEN_KEYS_STR + TOKEN_KEYS_SYM
|
8
|
+
|
5
9
|
attr_reader :client, :token, :expires_in, :expires_at, :expires_latency, :params
|
6
10
|
attr_accessor :options, :refresh_token, :response
|
7
11
|
|
8
12
|
class << self
|
9
13
|
# Initializes an AccessToken from a Hash
|
10
14
|
#
|
11
|
-
# @param
|
12
|
-
# @param
|
15
|
+
# @param [Client] client the OAuth2::Client instance
|
16
|
+
# @param [Hash] hash a hash of AccessToken property values
|
17
|
+
# @option hash [String] 'access_token', 'id_token', 'token', :access_token, :id_token, or :token the access token
|
13
18
|
# @return [AccessToken] the initialized AccessToken
|
14
19
|
def from_hash(client, hash)
|
15
|
-
|
16
|
-
|
20
|
+
fresh = hash.dup
|
21
|
+
supported_keys = TOKEN_KEY_LOOKUP & fresh.keys
|
22
|
+
key = supported_keys[0]
|
23
|
+
# Having too many is sus, and may lead to bugs. Having none is fine (e.g. refresh flow doesn't need a token).
|
24
|
+
warn("OAuth2::AccessToken.from_hash: `hash` contained more than one 'token' key (#{supported_keys}); using #{key.inspect}.") if supported_keys.length > 1
|
25
|
+
token = fresh.delete(key)
|
26
|
+
new(client, token, fresh)
|
17
27
|
end
|
18
28
|
|
19
29
|
# Initializes an AccessToken from a key/value application/x-www-form-urlencoded string
|
@@ -24,16 +34,12 @@ module OAuth2
|
|
24
34
|
def from_kvform(client, kvform)
|
25
35
|
from_hash(client, Rack::Utils.parse_query(kvform))
|
26
36
|
end
|
27
|
-
|
28
|
-
def contains_token?(hash)
|
29
|
-
hash.key?('access_token') || hash.key?('id_token') || hash.key?('token')
|
30
|
-
end
|
31
37
|
end
|
32
38
|
|
33
39
|
# Initialize an AccessToken
|
34
40
|
#
|
35
41
|
# @param [Client] client the OAuth2::Client instance
|
36
|
-
# @param [String] token the Access Token value
|
42
|
+
# @param [String] token the Access Token value (optional, may not be used in refresh flows)
|
37
43
|
# @param [Hash] opts the options to create the Access Token with
|
38
44
|
# @option opts [String] :refresh_token (nil) the refresh_token value
|
39
45
|
# @option opts [FixNum, String] :expires_in (nil) the number of seconds in which the AccessToken will expire
|
@@ -47,10 +53,20 @@ module OAuth2
|
|
47
53
|
def initialize(client, token, opts = {})
|
48
54
|
@client = client
|
49
55
|
@token = token.to_s
|
56
|
+
|
50
57
|
opts = opts.dup
|
51
58
|
%i[refresh_token expires_in expires_at expires_latency].each do |arg|
|
52
59
|
instance_variable_set("@#{arg}", opts.delete(arg) || opts.delete(arg.to_s))
|
53
60
|
end
|
61
|
+
no_tokens = (@token.nil? || @token.empty?) && (@refresh_token.nil? || @refresh_token.empty?)
|
62
|
+
if no_tokens
|
63
|
+
if @client.options[:raise_errors]
|
64
|
+
error = Error.new(opts)
|
65
|
+
raise(error)
|
66
|
+
else
|
67
|
+
warn('OAuth2::AccessToken has no token')
|
68
|
+
end
|
69
|
+
end
|
54
70
|
@expires_in ||= opts.delete('expires')
|
55
71
|
@expires_in &&= @expires_in.to_i
|
56
72
|
@expires_at &&= convert_expires_at(@expires_at)
|
@@ -95,7 +111,11 @@ module OAuth2
|
|
95
111
|
params[:refresh_token] = refresh_token
|
96
112
|
new_token = @client.get_token(params, access_token_opts)
|
97
113
|
new_token.options = options
|
98
|
-
|
114
|
+
if new_token.refresh_token
|
115
|
+
# Keep it, if there is one
|
116
|
+
else
|
117
|
+
new_token.refresh_token = refresh_token
|
118
|
+
end
|
99
119
|
new_token
|
100
120
|
end
|
101
121
|
# A compatibility alias
|
data/lib/oauth2/client.rb
CHANGED
@@ -157,43 +157,50 @@ module OAuth2
|
|
157
157
|
def get_token(params, access_token_opts = {}, extract_access_token = nil, &block)
|
158
158
|
warn('OAuth2::Client#get_token argument `extract_access_token` will be removed in oauth2 v3. Refactor to use `access_token_class` on #initialize.') if extract_access_token
|
159
159
|
extract_access_token ||= options[:extract_access_token]
|
160
|
-
|
161
|
-
if RESERVED_PARAM_KEYS.include?(key)
|
162
|
-
[key.to_sym, value]
|
163
|
-
else
|
164
|
-
[key, value]
|
165
|
-
end
|
166
|
-
end.to_h
|
160
|
+
parse, snaky, params, headers = parse_snaky_params_headers(params)
|
167
161
|
|
168
162
|
request_opts = {
|
169
163
|
raise_errors: options[:raise_errors],
|
170
|
-
parse:
|
171
|
-
snaky:
|
164
|
+
parse: parse,
|
165
|
+
snaky: snaky,
|
172
166
|
}
|
173
|
-
params = authenticator.apply(params)
|
174
|
-
headers = params.delete(:headers) || {}
|
175
167
|
if options[:token_method] == :post
|
176
|
-
|
168
|
+
|
169
|
+
# NOTE: If proliferation of request types continues we should implement a parser solution for Request,
|
170
|
+
# just like we have with Response.
|
171
|
+
request_opts[:body] = if headers['Content-Type'] == 'application/json'
|
172
|
+
params.to_json
|
173
|
+
else
|
174
|
+
params
|
175
|
+
end
|
176
|
+
|
177
177
|
request_opts[:headers] = {'Content-Type' => 'application/x-www-form-urlencoded'}
|
178
178
|
else
|
179
179
|
request_opts[:params] = params
|
180
180
|
request_opts[:headers] = {}
|
181
181
|
end
|
182
182
|
request_opts[:headers].merge!(headers)
|
183
|
-
http_method = options[:token_method]
|
184
|
-
http_method = :post if http_method == :post_with_query_string
|
185
183
|
response = request(http_method, token_url, request_opts, &block)
|
186
184
|
|
187
185
|
# In v1.4.x, the deprecated extract_access_token option retrieves the token from the response.
|
188
186
|
# We preserve this behavior here, but a custom access_token_class that implements #from_hash
|
189
187
|
# should be used instead.
|
190
188
|
if extract_access_token
|
191
|
-
|
189
|
+
parse_response_legacy(response, access_token_opts, extract_access_token)
|
192
190
|
else
|
193
191
|
parse_response(response, access_token_opts)
|
194
192
|
end
|
195
193
|
end
|
196
194
|
|
195
|
+
# The HTTP Method of the request
|
196
|
+
# @return [Symbol] HTTP verb, one of :get, :post, :put, :delete
|
197
|
+
def http_method
|
198
|
+
http_meth = options[:token_method].to_sym
|
199
|
+
return :post if http_meth == :post_with_query_string
|
200
|
+
|
201
|
+
http_meth
|
202
|
+
end
|
203
|
+
|
197
204
|
# The Authorization Code strategy
|
198
205
|
#
|
199
206
|
# @see http://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-15#section-4.1
|
@@ -252,6 +259,22 @@ module OAuth2
|
|
252
259
|
|
253
260
|
private
|
254
261
|
|
262
|
+
def parse_snaky_params_headers(params)
|
263
|
+
params = params.map do |key, value|
|
264
|
+
if RESERVED_PARAM_KEYS.include?(key)
|
265
|
+
[key.to_sym, value]
|
266
|
+
else
|
267
|
+
[key, value]
|
268
|
+
end
|
269
|
+
end.to_h
|
270
|
+
parse = params.key?(:parse) ? params.delete(:parse) : Response::DEFAULT_OPTIONS[:parse]
|
271
|
+
snaky = params.key?(:snaky) ? params.delete(:snaky) : Response::DEFAULT_OPTIONS[:snaky]
|
272
|
+
params = authenticator.apply(params)
|
273
|
+
# authenticator may add :headers, and we remove them here
|
274
|
+
headers = params.delete(:headers) || {}
|
275
|
+
[parse, snaky, params, headers]
|
276
|
+
end
|
277
|
+
|
255
278
|
def execute_request(verb, url, opts = {})
|
256
279
|
url = connection.build_url(url).to_s
|
257
280
|
|
@@ -266,8 +289,8 @@ module OAuth2
|
|
266
289
|
raise TimeoutError, e
|
267
290
|
end
|
268
291
|
|
269
|
-
parse = opts.
|
270
|
-
snaky = opts.
|
292
|
+
parse = opts.key?(:parse) ? opts.delete(:parse) : Response::DEFAULT_OPTIONS[:parse]
|
293
|
+
snaky = opts.key?(:snaky) ? opts.delete(:snaky) : Response::DEFAULT_OPTIONS[:snaky]
|
271
294
|
|
272
295
|
Response.new(response, parse: parse, snaky: snaky)
|
273
296
|
end
|
@@ -279,8 +302,8 @@ module OAuth2
|
|
279
302
|
Authenticator.new(id, secret, options[:auth_scheme])
|
280
303
|
end
|
281
304
|
|
282
|
-
def
|
283
|
-
access_token =
|
305
|
+
def parse_response_legacy(response, access_token_opts, extract_access_token)
|
306
|
+
access_token = build_access_token_legacy(response, access_token_opts, extract_access_token)
|
284
307
|
|
285
308
|
return access_token if access_token
|
286
309
|
|
@@ -296,7 +319,7 @@ module OAuth2
|
|
296
319
|
access_token_class = options[:access_token_class]
|
297
320
|
data = response.parsed
|
298
321
|
|
299
|
-
unless data.is_a?(Hash) &&
|
322
|
+
unless data.is_a?(Hash) && !data.empty?
|
300
323
|
return unless options[:raise_errors]
|
301
324
|
|
302
325
|
error = Error.new(response)
|
@@ -318,7 +341,7 @@ module OAuth2
|
|
318
341
|
# Builds the access token from the response of the HTTP call with legacy extract_access_token
|
319
342
|
#
|
320
343
|
# @return [AccessToken] the initialized AccessToken
|
321
|
-
def
|
344
|
+
def build_access_token_legacy(response, access_token_opts, extract_access_token)
|
322
345
|
extract_access_token.call(self, response.parsed.merge(access_token_opts))
|
323
346
|
rescue StandardError
|
324
347
|
nil
|
data/lib/oauth2/error.rb
CHANGED
@@ -2,21 +2,29 @@
|
|
2
2
|
|
3
3
|
module OAuth2
|
4
4
|
class Error < StandardError
|
5
|
-
attr_reader :response, :code, :description
|
5
|
+
attr_reader :response, :body, :code, :description
|
6
6
|
|
7
7
|
# standard error codes include:
|
8
8
|
# 'invalid_request', 'invalid_client', 'invalid_token', 'invalid_grant', 'unsupported_grant_type', 'invalid_scope'
|
9
|
+
# response might be a Response object, or the response.parsed hash
|
9
10
|
def initialize(response)
|
10
11
|
@response = response
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
if response.respond_to?(:parsed)
|
13
|
+
if response.parsed.is_a?(Hash)
|
14
|
+
@code = response.parsed['error']
|
15
|
+
@description = response.parsed['error_description']
|
16
|
+
end
|
17
|
+
elsif response.is_a?(Hash)
|
18
|
+
@code = response['error']
|
19
|
+
@description = response['error_description']
|
17
20
|
end
|
18
|
-
|
19
|
-
|
21
|
+
@body = if response.respond_to?(:body)
|
22
|
+
response.body
|
23
|
+
else
|
24
|
+
@response
|
25
|
+
end
|
26
|
+
message_opts = parse_error_description(@code, @description)
|
27
|
+
super(error_message(@body, message_opts))
|
20
28
|
end
|
21
29
|
|
22
30
|
private
|
@@ -80,7 +80,7 @@ module OAuth2
|
|
80
80
|
assertion = build_assertion(claims, encoding_opts)
|
81
81
|
params = build_request(assertion, request_opts)
|
82
82
|
|
83
|
-
@client.get_token(params, response_opts
|
83
|
+
@client.get_token(params, response_opts)
|
84
84
|
end
|
85
85
|
|
86
86
|
private
|
@@ -25,7 +25,7 @@ module OAuth2
|
|
25
25
|
#
|
26
26
|
# @param [String] code The Authorization Code value
|
27
27
|
# @param [Hash] params additional params
|
28
|
-
# @param [Hash] opts
|
28
|
+
# @param [Hash] opts access_token_opts, @see Client#get_token
|
29
29
|
# @note that you must also provide a :redirect_uri with most OAuth 2.0 providers
|
30
30
|
def get_token(code, params = {}, opts = {})
|
31
31
|
params = {'grant_type' => 'authorization_code', 'code' => code}.merge(@client.redirection_params).merge(params)
|
@@ -19,7 +19,7 @@ module OAuth2
|
|
19
19
|
# @param [Hash] opts options
|
20
20
|
def get_token(params = {}, opts = {})
|
21
21
|
params = params.merge('grant_type' => 'client_credentials')
|
22
|
-
@client.get_token(params, opts
|
22
|
+
@client.get_token(params, opts)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/oauth2/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-
|
13
|
+
date: 2022-08-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -307,15 +307,15 @@ licenses:
|
|
307
307
|
- MIT
|
308
308
|
metadata:
|
309
309
|
homepage_uri: https://github.com/oauth-xx/oauth2
|
310
|
-
source_code_uri: https://github.com/oauth-xx/oauth2/tree/v2.0.
|
311
|
-
changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.
|
310
|
+
source_code_uri: https://github.com/oauth-xx/oauth2/tree/v2.0.7
|
311
|
+
changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.7/CHANGELOG.md
|
312
312
|
bug_tracker_uri: https://github.com/oauth-xx/oauth2/issues
|
313
|
-
documentation_uri: https://www.rubydoc.info/gems/oauth2/2.0.
|
313
|
+
documentation_uri: https://www.rubydoc.info/gems/oauth2/2.0.7
|
314
314
|
wiki_uri: https://github.com/oauth-xx/oauth2/wiki
|
315
315
|
rubygems_mfa_required: 'true'
|
316
316
|
post_install_message: |2+
|
317
317
|
|
318
|
-
You have installed oauth2 version
|
318
|
+
You have installed oauth2 version 2.0.7, congratulations!
|
319
319
|
|
320
320
|
There are BREAKING changes, but most will not encounter them, and updating your code should be easy!
|
321
321
|
|
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
339
|
- !ruby/object:Gem::Version
|
340
340
|
version: '0'
|
341
341
|
requirements: []
|
342
|
-
rubygems_version: 3.3.
|
342
|
+
rubygems_version: 3.3.18
|
343
343
|
signing_key:
|
344
344
|
specification_version: 4
|
345
345
|
summary: A Ruby wrapper for the OAuth 2.0 protocol.
|