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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6cfd8f7cfafbe33031713ab2c19625e5af28826d
4
- data.tar.gz: 93e0c11310aaa3f088cdf70ff924cf9503093693
3
+ metadata.gz: 64efdc0295fe13f971487849754fcbc62f47b7e1
4
+ data.tar.gz: a28f87be3a6ebcc144aea25b63628543dbd7aba3
5
5
  SHA512:
6
- metadata.gz: e1f4b1d486370e9cad55433f8bb6410768fbede976db16cf07bd2f9c9e1e12f8a07b12fbf35abc939c8285d4ff5ae9c312bceb1a8eac833e512aa032a0c78ed1
7
- data.tar.gz: 0e083965d16cf0067c372158f2d4a5147303f3d8f9059856eafb0204cc94b38edb32dba90b71df54411a217d12c87b2364f22904ce0f2aa236c16fde254d84af
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 OAuth 2.0 Web Login. Read the Line developers docs for more details: https://developers.line.me/web-login/integrating-web-login
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
 
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Line
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -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, {:site => 'https://access.line.me',
10
- :authorize_url => '/dialog/oauth/weblogin',
11
- :token_url => '/v1/oauth/accessToken',
12
- :proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
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['mid'] }
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('v1/profile').body)
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('/dialog/oauth/weblogin')
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('/v1/oauth/accessToken')
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
- 'mid' => 'hoge',
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.2
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: 2015-08-24 00:00:00.000000000 Z
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.2.2
91
+ rubygems_version: 2.5.1
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: OmniAuth strategy for Line