omniauth-facebook 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +4 -4
- data/example/app.rb +1 -1
- data/lib/omniauth/facebook/version.rb +1 -1
- data/lib/omniauth/strategies/facebook.rb +2 -2
- data/test/strategy_test.rb +11 -11
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2f4d990ad5efff4639bceb6166326edde272c174245f543841bf513e6cb6e8a
|
4
|
+
data.tar.gz: 6b26e2b46ae31387b0c57596355838f231a926857db3a01e0b0cff27a39e7f2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb8dd5746bdaf99f7541009a198c4bf1fea00eef655808bee2ef235ee52d593e06666a3251a05266d0b602b79d96604790d801ae7b2da72e2931dd17e0491348
|
7
|
+
data.tar.gz: 8c080431786e1c765e2457da31b6290f86602aff576139fcc8328160c516e0e4d4d557b68c406b1fb1fe85a5f83bdb47bc60d639fa0652088c4aa64aa4ed0275
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -41,7 +41,7 @@ Option name | Default | Explanation
|
|
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
42
|
`display` | `page` | The display context to show the authentication page. Options are: `page`, `popup` and `touch`. Read the Facebook docs for more details: https://developers.facebook.com/docs/reference/dialogs/oauth/
|
43
43
|
`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
|
-
`info_fields` |
|
44
|
+
`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
45
|
`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
46
|
`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
47
|
`secure_image_url` | `false` | Set to `true` to use https for the avatar image url returned in the auth hash.
|
@@ -58,14 +58,14 @@ end
|
|
58
58
|
|
59
59
|
### API Version
|
60
60
|
|
61
|
-
OmniAuth Facebook uses versioned API endpoints by default (current
|
61
|
+
OmniAuth Facebook uses versioned API endpoints by default (current v4.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 v7.0 (assuming that exists):
|
62
62
|
|
63
63
|
```ruby
|
64
64
|
use OmniAuth::Builder do
|
65
65
|
provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'],
|
66
66
|
client_options: {
|
67
|
-
site: 'https://graph.facebook.com/
|
68
|
-
authorize_url: "https://www.facebook.com/
|
67
|
+
site: 'https://graph.facebook.com/v7.0',
|
68
|
+
authorize_url: "https://www.facebook.com/v7.0/dialog/oauth"
|
69
69
|
}
|
70
70
|
end
|
71
71
|
```
|
data/example/app.rb
CHANGED
@@ -29,7 +29,7 @@ get '/client-side' do
|
|
29
29
|
window.fbAsyncInit = function() {
|
30
30
|
FB.init({
|
31
31
|
appId: '#{ENV['FACEBOOK_APP_ID']}',
|
32
|
-
version: '
|
32
|
+
version: 'v4.0',
|
33
33
|
cookie: true // IMPORTANT must enable cookies to allow the server to access the session
|
34
34
|
});
|
35
35
|
console.log("fb init");
|
@@ -12,8 +12,8 @@ module OmniAuth
|
|
12
12
|
DEFAULT_SCOPE = 'email'
|
13
13
|
|
14
14
|
option :client_options, {
|
15
|
-
site: 'https://graph.facebook.com/
|
16
|
-
authorize_url: "https://www.facebook.com/
|
15
|
+
site: 'https://graph.facebook.com/v4.0',
|
16
|
+
authorize_url: "https://www.facebook.com/v4.0/dialog/oauth",
|
17
17
|
token_url: 'oauth/access_token'
|
18
18
|
}
|
19
19
|
|
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 'https://graph.facebook.com/
|
12
|
+
assert_equal 'https://graph.facebook.com/v4.0', strategy.client.site
|
13
13
|
end
|
14
14
|
|
15
15
|
test 'has correct authorize url' do
|
16
|
-
assert_equal 'https://www.facebook.com/
|
16
|
+
assert_equal 'https://www.facebook.com/v4.0/dialog/oauth', strategy.client.options[:authorize_url]
|
17
17
|
end
|
18
18
|
|
19
19
|
test 'has correct token url with versioning' do
|
@@ -99,7 +99,7 @@ class InfoTest < StrategyTestCase
|
|
99
99
|
@options = { secure_image_url: true }
|
100
100
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
101
101
|
strategy.stubs(:raw_info).returns(raw_info)
|
102
|
-
assert_equal 'https://graph.facebook.com/
|
102
|
+
assert_equal 'https://graph.facebook.com/v4.0/321/picture', strategy.info['image']
|
103
103
|
end
|
104
104
|
|
105
105
|
test 'returns the image_url based of the client site' do
|
@@ -113,14 +113,14 @@ class InfoTest < StrategyTestCase
|
|
113
113
|
@options = { image_size: 'normal' }
|
114
114
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
115
115
|
strategy.stubs(:raw_info).returns(raw_info)
|
116
|
-
assert_equal 'http://graph.facebook.com/
|
116
|
+
assert_equal 'http://graph.facebook.com/v4.0/321/picture?type=normal', strategy.info['image']
|
117
117
|
end
|
118
118
|
|
119
119
|
test 'returns the image with size specified as a symbol in the `image_size` option' do
|
120
120
|
@options = { image_size: :normal }
|
121
121
|
raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
|
122
122
|
strategy.stubs(:raw_info).returns(raw_info)
|
123
|
-
assert_equal 'http://graph.facebook.com/
|
123
|
+
assert_equal 'http://graph.facebook.com/v4.0/321/picture?type=normal', strategy.info['image']
|
124
124
|
end
|
125
125
|
|
126
126
|
test 'returns the image with width and height specified in the `image_size` option' do
|
@@ -129,7 +129,7 @@ class InfoTest < StrategyTestCase
|
|
129
129
|
strategy.stubs(:raw_info).returns(raw_info)
|
130
130
|
assert_match 'width=123', strategy.info['image']
|
131
131
|
assert_match 'height=987', strategy.info['image']
|
132
|
-
assert_match 'http://graph.facebook.com/
|
132
|
+
assert_match 'http://graph.facebook.com/v4.0/321/picture?', strategy.info['image']
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
@@ -176,7 +176,7 @@ class InfoTestOptionalDataPresent < StrategyTestCase
|
|
176
176
|
|
177
177
|
test 'returns the facebook avatar url' do
|
178
178
|
@raw_info['id'] = '321'
|
179
|
-
assert_equal 'http://graph.facebook.com/
|
179
|
+
assert_equal 'http://graph.facebook.com/v4.0/321/picture', strategy.info['image']
|
180
180
|
end
|
181
181
|
|
182
182
|
test 'returns the Facebook link as the Facebook url' do
|
@@ -258,7 +258,7 @@ class RawInfoTest < StrategyTestCase
|
|
258
258
|
@options = {appsecret_proof: @appsecret_proof, fields: 'name,email'}
|
259
259
|
end
|
260
260
|
|
261
|
-
test 'performs a GET to https://graph.facebook.com/
|
261
|
+
test 'performs a GET to https://graph.facebook.com/v4.0/me' do
|
262
262
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
263
263
|
strategy.stubs(:access_token).returns(@access_token)
|
264
264
|
params = {params: @options}
|
@@ -266,7 +266,7 @@ class RawInfoTest < StrategyTestCase
|
|
266
266
|
strategy.raw_info
|
267
267
|
end
|
268
268
|
|
269
|
-
test 'performs a GET to https://graph.facebook.com/
|
269
|
+
test 'performs a GET to https://graph.facebook.com/v4.0/me with locale' do
|
270
270
|
@options.merge!({ locale: 'cs_CZ' })
|
271
271
|
strategy.stubs(:access_token).returns(@access_token)
|
272
272
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
@@ -275,7 +275,7 @@ class RawInfoTest < StrategyTestCase
|
|
275
275
|
strategy.raw_info
|
276
276
|
end
|
277
277
|
|
278
|
-
test 'performs a GET to https://graph.facebook.com/
|
278
|
+
test 'performs a GET to https://graph.facebook.com/v4.0/me with info_fields' do
|
279
279
|
@options.merge!({info_fields: 'about'})
|
280
280
|
strategy.stubs(:access_token).returns(@access_token)
|
281
281
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
@@ -284,7 +284,7 @@ class RawInfoTest < StrategyTestCase
|
|
284
284
|
strategy.raw_info
|
285
285
|
end
|
286
286
|
|
287
|
-
test 'performs a GET to https://graph.facebook.com/
|
287
|
+
test 'performs a GET to https://graph.facebook.com/v4.0/me with default info_fields' do
|
288
288
|
strategy.stubs(:access_token).returns(@access_token)
|
289
289
|
strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
|
290
290
|
params = {params: {appsecret_proof: @appsecret_proof, fields: 'name,email'}}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-facebook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Dodwell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth-oauth2
|
@@ -117,8 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
|
-
|
121
|
-
rubygems_version: 2.7.6.2
|
120
|
+
rubygems_version: 3.2.0.pre1
|
122
121
|
signing_key:
|
123
122
|
specification_version: 4
|
124
123
|
summary: Facebook OAuth2 Strategy for OmniAuth
|