omniauth-facebook 8.0.0 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +25 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +1 -5
- data/README.md +10 -8
- data/example/Gemfile.lock +12 -11
- data/lib/omniauth/facebook/signed_request.rb +1 -1
- data/lib/omniauth/facebook/version.rb +1 -1
- data/lib/omniauth/strategies/facebook.rb +9 -6
- data/omniauth-facebook.gemspec +2 -1
- data/test/helper.rb +3 -1
- data/test/signed_request_test.rb +1 -1
- data/test/strategy_test.rb +37 -15
- metadata +30 -10
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a121c1f37d032c1669ec67eb4cd7629f569dfc063e69f054a776a80b68409eb
|
4
|
+
data.tar.gz: 5b38258394e3cac9e7579ccb5bbe2af62034965ab870739fcf7e94800cb614be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '00297b6593b4a91e1738df9d6af7bb9252ca8404fb0ed0d269580337557f9f777a43fc121abbca9627bb83f085e6f7192eee8e959876c5a158b0bdb925831983'
|
7
|
+
data.tar.gz: e8029bc7178ec6675393f7689de9c531977981e5f5b589be5ad5238d78f01a8a1bec93a539cbcac490ac91d62f3a0270336bfaddc9a5c3cf924fe95711a2abbe
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby:
|
12
|
+
- "3.0"
|
13
|
+
- "3.1"
|
14
|
+
- "3.2"
|
15
|
+
- "3.3"
|
16
|
+
- head
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v4
|
19
|
+
- name: Set up Ruby
|
20
|
+
uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
bundler-cache: true # 'bundle install' and cache
|
24
|
+
- name: Run tests
|
25
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -39,12 +39,14 @@ You can configure several options, which you pass in to the `provider` method vi
|
|
39
39
|
Option name | Default | Explanation
|
40
40
|
--- | --- | ---
|
41
41
|
`scope` | `email` | A comma-separated list of permissions you want to request from the user. See the Facebook docs for a full list of available permissions: https://developers.facebook.com/docs/reference/login/
|
42
|
-
`display` | `page` | The display context to show the authentication page. Options are: `page`, `popup` and
|
42
|
+
`display` | `page` | The display context to show the authentication page. Options are: `page`, `popup` and
|
43
|
+
`config_id` | | The configuration ID to use for a System User access token with Facebook Login for Business. Read the Facebook docs for more details: https://developers.facebook.com/docs/facebook-login/facebook-login-for-business#invoke-a--login-dialog
|
44
|
+
`touch`. Read the Facebook docs for more details: https://developers.facebook.com/docs/reference/dialogs/oauth/
|
43
45
|
`image_size` | `square` | Set the size for the returned image url in the auth hash. Valid options include `square` (50x50), `small` (50 pixels wide, variable height), `normal` (100 pixels wide, variable height), or `large` (about 200 pixels wide, variable height). Additionally, you can request a picture of a specific size by setting this option to a hash with `:width` and `:height` as keys. This will return an available profile picture closest to the requested size and requested aspect ratio. If only `:width` or `:height` is specified, we will return a picture whose width or height is closest to the requested size, respectively.
|
44
46
|
`info_fields` | `name,email` | Specify exactly which fields should be returned when getting the user's info. Value should be a comma-separated string as per https://developers.facebook.com/docs/graph-api/reference/user/ (only `/me` endpoint).
|
45
47
|
`locale` | | Specify locale which should be used when getting the user's info. Value should be locale string as per https://developers.facebook.com/docs/reference/api/locale/.
|
46
48
|
`auth_type` | | Optionally specifies the requested authentication features as a comma-separated list, as per https://developers.facebook.com/docs/facebook-login/reauthentication/. Valid values are `https` (checks for the presence of the secure cookie and asks for re-authentication if it is not present), and `reauthenticate` (asks the user to re-authenticate unconditionally). Use 'rerequest' when you want to request premissions. Default is `nil`.
|
47
|
-
`secure_image_url` | `
|
49
|
+
`secure_image_url` | `true` | Set to `true` to use https for the avatar image url returned in the auth hash. SSL is mandatory as per https://developers.facebook.com/docs/facebook-login/security#surfacearea.
|
48
50
|
`callback_url` / `callback_path` | | Specify a custom callback URL used during the server-side flow. Note this must be allowed by your app configuration on Facebook (see 'Valid OAuth redirect URIs' under the 'Advanced' settings section in the configuration for your Facebook app for more details).
|
49
51
|
|
50
52
|
For example, to request `email`, `user_birthday` and `read_stream` permissions and display the authentication page in a popup window:
|
@@ -58,21 +60,21 @@ end
|
|
58
60
|
|
59
61
|
### API Version
|
60
62
|
|
61
|
-
OmniAuth Facebook uses versioned API endpoints by default (current
|
63
|
+
OmniAuth Facebook uses versioned API endpoints by default (current v19.0). You can configure a different version via `client_options` hash passed to `provider`, specifically you should change the version in the `site` and `authorize_url` parameters. For example, to change to v20.0 (assuming that exists):
|
62
64
|
|
63
65
|
```ruby
|
64
66
|
use OmniAuth::Builder do
|
65
67
|
provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'],
|
66
68
|
client_options: {
|
67
|
-
site: 'https://graph.facebook.com/
|
68
|
-
authorize_url: "https://www.facebook.com/
|
69
|
+
site: 'https://graph.facebook.com/v20.0',
|
70
|
+
authorize_url: "https://www.facebook.com/v20.0/dialog/oauth"
|
69
71
|
}
|
70
72
|
end
|
71
73
|
```
|
72
74
|
|
73
75
|
### Per-Request Options
|
74
76
|
|
75
|
-
If you want to set the `display` format, `auth_type`, or `
|
77
|
+
If you want to set the `display` format, `auth_type`, `scope` or `config_id` on a per-request basis, you can just pass it to the OmniAuth request phase URL, for example: `/auth/facebook?display=popup`, `/auth/facebook?scope=email` or `/auth/facebook?config_id=001`.
|
76
78
|
|
77
79
|
## Auth Hash
|
78
80
|
|
@@ -87,7 +89,7 @@ Here's an example *Auth Hash* available in `request.env['omniauth.auth']`:
|
|
87
89
|
name: 'Joe Bloggs',
|
88
90
|
first_name: 'Joe',
|
89
91
|
last_name: 'Bloggs',
|
90
|
-
image: 'http://graph.facebook.com/1234567/picture?type=square',
|
92
|
+
image: 'http://graph.facebook.com/1234567/picture?type=square&access_token=...',
|
91
93
|
verified: true
|
92
94
|
},
|
93
95
|
credentials: {
|
@@ -152,7 +154,7 @@ If you use the server-side flow, Facebook will give you back a longer lived acce
|
|
152
154
|
|
153
155
|
## Supported Rubies
|
154
156
|
|
155
|
-
- Ruby MRI (
|
157
|
+
- Ruby MRI (3.0, 3.1, 3.2 and 3.3)
|
156
158
|
|
157
159
|
## License
|
158
160
|
|
data/example/Gemfile.lock
CHANGED
@@ -1,35 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
omniauth-facebook (
|
4
|
+
omniauth-facebook (8.0.0)
|
5
5
|
omniauth-oauth2 (~> 1.2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
backports (3.15.0)
|
11
|
-
faraday (1.
|
11
|
+
faraday (1.1.0)
|
12
12
|
multipart-post (>= 1.2, < 3)
|
13
|
-
|
14
|
-
|
13
|
+
ruby2_keywords
|
14
|
+
hashie (4.1.0)
|
15
|
+
jwt (2.2.2)
|
15
16
|
multi_json (1.14.1)
|
16
17
|
multi_xml (0.6.0)
|
17
18
|
multipart-post (2.1.1)
|
18
19
|
mustermann (1.1.1)
|
19
20
|
ruby2_keywords (~> 0.0.1)
|
20
|
-
oauth2 (1.4.
|
21
|
+
oauth2 (1.4.4)
|
21
22
|
faraday (>= 0.8, < 2.0)
|
22
23
|
jwt (>= 1.0, < 3.0)
|
23
24
|
multi_json (~> 1.3)
|
24
25
|
multi_xml (~> 0.5)
|
25
26
|
rack (>= 1.2, < 3)
|
26
|
-
omniauth (1.9.
|
27
|
-
hashie (>= 3.4.6
|
27
|
+
omniauth (1.9.1)
|
28
|
+
hashie (>= 3.4.6)
|
28
29
|
rack (>= 1.6.2, < 3)
|
29
|
-
omniauth-oauth2 (1.
|
30
|
-
oauth2 (~> 1.
|
30
|
+
omniauth-oauth2 (1.7.0)
|
31
|
+
oauth2 (~> 1.4)
|
31
32
|
omniauth (~> 1.9)
|
32
|
-
rack (2.
|
33
|
+
rack (2.2.3)
|
33
34
|
rack-protection (2.0.8.1)
|
34
35
|
rack
|
35
36
|
ruby2_keywords (0.0.2)
|
@@ -59,4 +60,4 @@ DEPENDENCIES
|
|
59
60
|
sinatra-reloader
|
60
61
|
|
61
62
|
BUNDLED WITH
|
62
|
-
1.17.
|
63
|
+
1.17.3
|
@@ -28,7 +28,7 @@ module OmniAuth
|
|
28
28
|
return if signature.nil?
|
29
29
|
|
30
30
|
decoded_hex_signature = base64_decode_url(signature)
|
31
|
-
decoded_payload =
|
31
|
+
decoded_payload = JSON.parse(base64_decode_url(encoded_payload))
|
32
32
|
|
33
33
|
unless decoded_payload['algorithm'] == SUPPORTED_ALGORITHM
|
34
34
|
raise UnknownSignatureAlgorithmError, "unknown algorithm: #{decoded_payload['algorithm']}"
|
@@ -10,10 +10,11 @@ module OmniAuth
|
|
10
10
|
class NoAuthorizationCodeError < StandardError; end
|
11
11
|
|
12
12
|
DEFAULT_SCOPE = 'email'
|
13
|
+
DEFAULT_FACEBOOK_API_VERSION = 'v19.0'.freeze
|
13
14
|
|
14
15
|
option :client_options, {
|
15
|
-
site:
|
16
|
-
authorize_url: "https://www.facebook.com/
|
16
|
+
site: "https://graph.facebook.com/#{DEFAULT_FACEBOOK_API_VERSION}",
|
17
|
+
authorize_url: "https://www.facebook.com/#{DEFAULT_FACEBOOK_API_VERSION}/dialog/oauth",
|
17
18
|
token_url: 'oauth/access_token'
|
18
19
|
}
|
19
20
|
|
@@ -24,7 +25,9 @@ module OmniAuth
|
|
24
25
|
|
25
26
|
option :authorization_code_from_signed_request_in_cookie, nil
|
26
27
|
|
27
|
-
option :authorize_options, [:scope, :display, :auth_type]
|
28
|
+
option :authorize_options, [:scope, :display, :auth_type, :config_id]
|
29
|
+
|
30
|
+
option :secure_image_url, true
|
28
31
|
|
29
32
|
uid { raw_info['id'] }
|
30
33
|
|
@@ -82,7 +85,7 @@ module OmniAuth
|
|
82
85
|
''
|
83
86
|
else
|
84
87
|
# Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7
|
85
|
-
options[:callback_url] || (full_host +
|
88
|
+
options[:callback_url] || (full_host + callback_path)
|
86
89
|
end
|
87
90
|
end
|
88
91
|
|
@@ -90,13 +93,13 @@ module OmniAuth
|
|
90
93
|
options.access_token_options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }
|
91
94
|
end
|
92
95
|
|
93
|
-
# You can pass +display+, +scope+, or +
|
96
|
+
# You can pass +display+, +scope+, +auth_type+ or +config_id+ params to the auth request, if you need to set them dynamically.
|
94
97
|
# You can also set these options in the OmniAuth config :authorize_params option.
|
95
98
|
#
|
96
99
|
# For example: /auth/facebook?display=popup
|
97
100
|
def authorize_params
|
98
101
|
super.tap do |params|
|
99
|
-
%w[display scope auth_type].each do |v|
|
102
|
+
%w[display scope auth_type config_id].each do |v|
|
100
103
|
if request.params[v]
|
101
104
|
params[v.to_sym] = request.params[v]
|
102
105
|
end
|
data/omniauth-facebook.gemspec
CHANGED
@@ -16,7 +16,8 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
17
17
|
s.require_paths = ['lib']
|
18
18
|
|
19
|
-
s.add_runtime_dependency 'omniauth-oauth2', '
|
19
|
+
s.add_runtime_dependency 'omniauth-oauth2', '>= 1.2', '< 3'
|
20
|
+
s.add_runtime_dependency 'bigdecimal'
|
20
21
|
|
21
22
|
s.add_development_dependency 'minitest'
|
22
23
|
s.add_development_dependency 'mocha'
|
data/test/helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'bundler/setup'
|
2
2
|
require 'minitest/autorun'
|
3
|
-
require 'mocha/
|
3
|
+
require 'mocha/minitest'
|
4
4
|
require 'omniauth/strategies/facebook'
|
5
5
|
|
6
6
|
OmniAuth.config.test_mode = true
|
@@ -42,6 +42,8 @@ class StrategyTestCase < TestCase
|
|
42
42
|
@client_id = '123'
|
43
43
|
@client_secret = '53cr3tz'
|
44
44
|
@options = {}
|
45
|
+
|
46
|
+
@facebook_api_version = OmniAuth::Strategies::Facebook::DEFAULT_FACEBOOK_API_VERSION
|
45
47
|
end
|
46
48
|
|
47
49
|
def strategy
|
data/test/signed_request_test.rb
CHANGED
@@ -5,7 +5,7 @@ class SignedRequestTest < Minitest::Test
|
|
5
5
|
def setup
|
6
6
|
@value = fixture('signed_request.txt').strip
|
7
7
|
@secret = "897z956a2z7zzzzz5783z458zz3z7556"
|
8
|
-
@expected_payload =
|
8
|
+
@expected_payload = JSON.parse(fixture('payload.json'))
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_signed_request_payload
|
data/test/strategy_test.rb
CHANGED
@@ -9,11 +9,11 @@ end
|
|
9
9
|
|
10
10
|
class ClientTest < StrategyTestCase
|
11
11
|
test 'has correct Facebook site' do
|
12
|
-
assert_equal
|
12
|
+
assert_equal "https://graph.facebook.com/#{@facebook_api_version}", strategy.client.site
|
13
13
|
end
|
14
14
|
|
15
15
|
test 'has correct authorize url' do
|
16
|
-
assert_equal
|
16
|
+
assert_equal "https://www.facebook.com/#{@facebook_api_version}/dialog/oauth", strategy.client.options[:authorize_url]
|
17
17
|
end
|
18
18
|
|
19
19
|
test 'has correct token url with versioning' do
|
@@ -26,10 +26,11 @@ end
|
|
26
26
|
class CallbackUrlTest < StrategyTestCase
|
27
27
|
test "returns the default callback url (omitting querystring)" do
|
28
28
|
url_base = 'http://auth.request.com'
|
29
|
+
script_name = '/script_name'
|
29
30
|
@request.stubs(:url).returns("#{url_base}/some/page")
|
30
|
-
strategy.stubs(:script_name).returns(
|
31
|
+
strategy.stubs(:script_name).returns(script_name) # as not to depend on Rack env
|
31
32
|
strategy.stubs(:query_string).returns('?foo=bar')
|
32
|
-
assert_equal "#{url_base}/auth/facebook/callback", strategy.callback_url
|
33
|
+
assert_equal "#{url_base}#{script_name}/auth/facebook/callback", strategy.callback_url
|
33
34
|
end
|
34
35
|
|
35
36
|
test "returns path from callback_path option (omitting querystring)" do
|
@@ -60,6 +61,12 @@ class AuthorizeParamsTest < StrategyTestCase
|
|
60
61
|
assert_equal 'touch', strategy.authorize_params[:display]
|
61
62
|
end
|
62
63
|
|
64
|
+
test 'includes config_id parameter from request when present' do
|
65
|
+
@request.stubs(:params).returns({ 'config_id' => '000111222' })
|
66
|
+
assert strategy.authorize_params.is_a?(Hash)
|
67
|
+
assert_equal '000111222', strategy.authorize_params[:config_id]
|
68
|
+
end
|
69
|
+
|
63
70
|
test 'includes auth_type parameter from request when present' do
|
64
71
|
@request.stubs(:params).returns({ 'auth_type' => 'reauthenticate' })
|
65
72
|
assert strategy.authorize_params.is_a?(Hash)
|
@@ -101,12 +108,27 @@ class InfoTest < StrategyTestCase
|
|
101
108
|
@access_token.stubs(:token).returns('test_access_token')
|
102
109
|
end
|
103
110
|
|
104
|
-
test 'returns the secure facebook avatar url when `secure_image_url` option is
|
111
|
+
test 'returns the secure facebook avatar url when `secure_image_url` option is set to true' do
|
105
112
|
@options = { secure_image_url: true }
|
106
113
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
107
114
|
strategy.stubs(:raw_info).returns(raw_info)
|
108
115
|
strategy.stubs(:access_token).returns(@access_token)
|
109
|
-
assert_equal
|
116
|
+
assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
|
117
|
+
end
|
118
|
+
|
119
|
+
test 'returns the non-ssl facebook avatar url when `secure_image_url` option is set to false' do
|
120
|
+
@options = { secure_image_url: false }
|
121
|
+
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
122
|
+
strategy.stubs(:raw_info).returns(raw_info)
|
123
|
+
strategy.stubs(:access_token).returns(@access_token)
|
124
|
+
assert_equal "http://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
|
125
|
+
end
|
126
|
+
|
127
|
+
test 'returns the secure facebook avatar url when `secure_image_url` option is omitted' do
|
128
|
+
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
129
|
+
strategy.stubs(:raw_info).returns(raw_info)
|
130
|
+
strategy.stubs(:access_token).returns(@access_token)
|
131
|
+
assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
|
110
132
|
end
|
111
133
|
|
112
134
|
test 'returns the image_url based of the client site' do
|
@@ -122,7 +144,7 @@ class InfoTest < StrategyTestCase
|
|
122
144
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
123
145
|
strategy.stubs(:raw_info).returns(raw_info)
|
124
146
|
strategy.stubs(:access_token).returns(@access_token)
|
125
|
-
assert_equal
|
147
|
+
assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token&type=normal", strategy.info['image']
|
126
148
|
end
|
127
149
|
|
128
150
|
test 'returns the image with size specified as a symbol in the `image_size` option' do
|
@@ -130,7 +152,7 @@ class InfoTest < StrategyTestCase
|
|
130
152
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
131
153
|
strategy.stubs(:raw_info).returns(raw_info)
|
132
154
|
strategy.stubs(:access_token).returns(@access_token)
|
133
|
-
assert_equal
|
155
|
+
assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token&type=normal", strategy.info['image']
|
134
156
|
end
|
135
157
|
|
136
158
|
test 'returns the image with width and height specified in the `image_size` option' do
|
@@ -140,7 +162,7 @@ class InfoTest < StrategyTestCase
|
|
140
162
|
strategy.stubs(:access_token).returns(@access_token)
|
141
163
|
assert_match 'width=123', strategy.info['image']
|
142
164
|
assert_match 'height=987', strategy.info['image']
|
143
|
-
assert_match
|
165
|
+
assert_match "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
|
144
166
|
end
|
145
167
|
end
|
146
168
|
|
@@ -191,7 +213,7 @@ class InfoTestOptionalDataPresent < StrategyTestCase
|
|
191
213
|
|
192
214
|
test 'returns the facebook avatar url' do
|
193
215
|
@raw_info['id'] = '321'
|
194
|
-
assert_equal
|
216
|
+
assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
|
195
217
|
end
|
196
218
|
|
197
219
|
test 'returns the Facebook link as the Facebook url' do
|
@@ -277,7 +299,7 @@ class RawInfoTest < StrategyTestCase
|
|
277
299
|
@options = {appsecret_proof: @appsecret_proof, fields: 'name,email'}
|
278
300
|
end
|
279
301
|
|
280
|
-
test
|
302
|
+
test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me" do
|
281
303
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
282
304
|
strategy.stubs(:access_token).returns(@access_token)
|
283
305
|
params = {params: @options}
|
@@ -285,7 +307,7 @@ class RawInfoTest < StrategyTestCase
|
|
285
307
|
strategy.raw_info
|
286
308
|
end
|
287
309
|
|
288
|
-
test
|
310
|
+
test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me with locale" do
|
289
311
|
@options.merge!({ locale: 'cs_CZ' })
|
290
312
|
strategy.stubs(:access_token).returns(@access_token)
|
291
313
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
@@ -294,7 +316,7 @@ class RawInfoTest < StrategyTestCase
|
|
294
316
|
strategy.raw_info
|
295
317
|
end
|
296
318
|
|
297
|
-
test
|
319
|
+
test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me with info_fields" do
|
298
320
|
@options.merge!({info_fields: 'about'})
|
299
321
|
strategy.stubs(:access_token).returns(@access_token)
|
300
322
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
@@ -303,7 +325,7 @@ class RawInfoTest < StrategyTestCase
|
|
303
325
|
strategy.raw_info
|
304
326
|
end
|
305
327
|
|
306
|
-
test
|
328
|
+
test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me with default info_fields" do
|
307
329
|
strategy.stubs(:access_token).returns(@access_token)
|
308
330
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
309
331
|
params = {params: {appsecret_proof: @appsecret_proof, fields: 'name,email'}}
|
@@ -412,7 +434,7 @@ end
|
|
412
434
|
|
413
435
|
module SignedRequestHelpers
|
414
436
|
def signed_request(payload, secret)
|
415
|
-
encoded_payload = base64_encode_url(
|
437
|
+
encoded_payload = base64_encode_url(JSON.dump(payload))
|
416
438
|
encoded_signature = base64_encode_url(signature(encoded_payload, secret))
|
417
439
|
[encoded_signature, encoded_payload].join('.')
|
418
440
|
end
|
metadata
CHANGED
@@ -1,30 +1,50 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-facebook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 10.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Dodwell
|
8
8
|
- Josef Šimánek
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth-oauth2
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.2'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '3'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: '1.2'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: bigdecimal
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
type: :runtime
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
28
48
|
- !ruby/object:Gem::Dependency
|
29
49
|
name: minitest
|
30
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,7 +87,7 @@ dependencies:
|
|
67
87
|
- - ">="
|
68
88
|
- !ruby/object:Gem::Version
|
69
89
|
version: '0'
|
70
|
-
description:
|
90
|
+
description:
|
71
91
|
email:
|
72
92
|
- mark@madeofcode.com
|
73
93
|
- retro@ballgag.cz
|
@@ -75,9 +95,9 @@ executables: []
|
|
75
95
|
extensions: []
|
76
96
|
extra_rdoc_files: []
|
77
97
|
files:
|
98
|
+
- ".github/workflows/ci.yml"
|
78
99
|
- ".github/workflows/stale.yml"
|
79
100
|
- ".gitignore"
|
80
|
-
- ".travis.yml"
|
81
101
|
- CHANGELOG.md
|
82
102
|
- Gemfile
|
83
103
|
- README.md
|
@@ -102,7 +122,7 @@ homepage: https://github.com/simi/omniauth-facebook
|
|
102
122
|
licenses:
|
103
123
|
- MIT
|
104
124
|
metadata: {}
|
105
|
-
post_install_message:
|
125
|
+
post_install_message:
|
106
126
|
rdoc_options: []
|
107
127
|
require_paths:
|
108
128
|
- lib
|
@@ -117,8 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
137
|
- !ruby/object:Gem::Version
|
118
138
|
version: '0'
|
119
139
|
requirements: []
|
120
|
-
rubygems_version: 3.
|
121
|
-
signing_key:
|
140
|
+
rubygems_version: 3.4.0.dev
|
141
|
+
signing_key:
|
122
142
|
specification_version: 4
|
123
143
|
summary: Facebook OAuth2 Strategy for OmniAuth
|
124
144
|
test_files:
|