omniauth-line 0.0.2 → 0.0.3
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/README.md +1 -1
- data/lib/omniauth-line/version.rb +1 -1
- data/lib/omniauth/strategies/line.rb +8 -6
- data/spec/omniauth/strategies/line_spec.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64efdc0295fe13f971487849754fcbc62f47b7e1
|
4
|
+
data.tar.gz: a28f87be3a6ebcc144aea25b63628543dbd7aba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 840f17218175c836fe16b9a736a95bb91d53c5ddf95f4dd9a960de750a596c316d6de0cc69399d6b7d052aa26f8cae232a974f136dadc98f7b2ae6fb5fc69312
|
7
|
+
data.tar.gz: bf13a0b3bf25bc9a3c30f0926a5559124e6f0f989062ee00d1ae87d9683048b8d7692659d281586db66b97c820eae9bae3f0b74cba383850a1ec649cfa11ded3
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
This gem contains the Line OAuth2 Strategy for OmniAuth.
|
4
4
|
|
5
|
-
Supports the
|
5
|
+
Supports the OpenID Connect Web Login. Read the Line developers docs for more details: https://developers.line.me/en/docs/line-login/web/integrate-line-login/
|
6
6
|
|
7
7
|
## Using This Strategy
|
8
8
|
|
@@ -5,11 +5,13 @@ module OmniAuth
|
|
5
5
|
module Strategies
|
6
6
|
class Line < OmniAuth::Strategies::OAuth2
|
7
7
|
option :name, 'line'
|
8
|
+
option :scope, 'profile openid'
|
8
9
|
|
9
|
-
option :client_options, {
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
option :client_options, {
|
11
|
+
site: 'https://access.line.me',
|
12
|
+
authorize_url: '/oauth2/v2.1/authorize',
|
13
|
+
token_url: '/oauth2/v2.1/token'
|
14
|
+
}
|
13
15
|
|
14
16
|
# host changed
|
15
17
|
def callback_phase
|
@@ -17,7 +19,7 @@ module OmniAuth
|
|
17
19
|
super
|
18
20
|
end
|
19
21
|
|
20
|
-
uid { raw_info['
|
22
|
+
uid { raw_info['userId'] }
|
21
23
|
|
22
24
|
info do
|
23
25
|
{
|
@@ -29,7 +31,7 @@ module OmniAuth
|
|
29
31
|
|
30
32
|
# Require: Access token with PROFILE permission issued.
|
31
33
|
def raw_info
|
32
|
-
@raw_info ||= JSON.load(access_token.get('
|
34
|
+
@raw_info ||= JSON.load(access_token.get('v2/profile').body)
|
33
35
|
rescue ::Errno::ETIMEDOUT
|
34
36
|
raise ::Timeout::Error
|
35
37
|
end
|
@@ -22,11 +22,11 @@ describe OmniAuth::Strategies::Line do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
it 'should have correct authorize url' do
|
25
|
-
expect(subject.options.client_options.authorize_url).to eq('/
|
25
|
+
expect(subject.options.client_options.authorize_url).to eq('/oauth2/v2.1/authorize')
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'should have correct token url' do
|
29
|
-
expect(subject.options.client_options.token_url).to eq('/
|
29
|
+
expect(subject.options.client_options.token_url).to eq('/oauth2/v2.1/token')
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -79,7 +79,7 @@ private
|
|
79
79
|
|
80
80
|
def raw_info_hash
|
81
81
|
{
|
82
|
-
'
|
82
|
+
'uid' => 'hoge',
|
83
83
|
'displayName' => 'Foo Bar',
|
84
84
|
'pictureUrl' => 'http://xxx.com/aaa.jpg',
|
85
85
|
'statusMessage' => 'Developer'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-line
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kazasiki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.5.1
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: OmniAuth strategy for Line
|