omniauth-line 0.1.0 → 0.2.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/.github/dependabot.yml +10 -0
- data/.github/workflows/ci.yml +33 -0
- data/.github/workflows/release.yml +56 -0
- data/.gitignore +5 -0
- data/CHANGELOG.md +29 -0
- data/LICENSE +21 -0
- data/README.md +53 -6
- data/lib/omniauth/strategies/line.rb +42 -4
- data/lib/omniauth-line/version.rb +1 -1
- data/omniauth-line.gemspec +5 -3
- data/spec/omniauth/strategies/line_spec.rb +60 -3
- metadata +35 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea68da016dcc1ec022eaf5b77bc638cfeda11276a7ef259be89bc869afd876b0
|
|
4
|
+
data.tar.gz: 62e3877546b29e4bb8281ea450b4cf1a2e55f9653421d0a00ced23eb1d6a0a55
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9af31a14d1ca5f5967cf488bd9d97051317df1311f0bafb98db9dcc5c520695ab47477f33659e899b6e9d3b9adef19ee410707dfcb9425b7e37a8280c88d4b53
|
|
7
|
+
data.tar.gz: c48b417ecc11134d5dc4a0341a0fcf6cc2ac5382233080c060ce4e6d7fdb0c57b44fce8d2250d51a7bdb18c2daf98f6b19ba99d391a6a9ed6e4c24aa86329e83
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test (Ruby ${{ matrix.ruby-version }})
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
ruby-version:
|
|
17
|
+
- '3.1'
|
|
18
|
+
- '3.2'
|
|
19
|
+
- '3.3'
|
|
20
|
+
- '3.4'
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Check out source code
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Set up Ruby
|
|
27
|
+
uses: ruby/setup-ruby@v1
|
|
28
|
+
with:
|
|
29
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
30
|
+
bundler-cache: true
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: bundle exec rake
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Release to RubyGems
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
name: Test (Ruby ${{ matrix.ruby-version }})
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
ruby-version:
|
|
19
|
+
- '3.1'
|
|
20
|
+
- '3.2'
|
|
21
|
+
- '3.3'
|
|
22
|
+
- '3.4'
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Check out source code
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Set up Ruby
|
|
29
|
+
uses: ruby/setup-ruby@v1
|
|
30
|
+
with:
|
|
31
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
32
|
+
bundler-cache: true
|
|
33
|
+
|
|
34
|
+
- name: Run tests
|
|
35
|
+
run: bundle exec rake
|
|
36
|
+
|
|
37
|
+
release:
|
|
38
|
+
name: Build and Push Gem
|
|
39
|
+
needs: test
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
permissions:
|
|
42
|
+
contents: read
|
|
43
|
+
id-token: write
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- name: Check out source code
|
|
47
|
+
uses: actions/checkout@v4
|
|
48
|
+
|
|
49
|
+
- name: Set up Ruby
|
|
50
|
+
uses: ruby/setup-ruby@v1
|
|
51
|
+
with:
|
|
52
|
+
ruby-version: '3.4'
|
|
53
|
+
bundler-cache: true
|
|
54
|
+
|
|
55
|
+
- name: Release to RubyGems
|
|
56
|
+
uses: rubygems/release-gem@v1
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.2.0] - 2026-11-18
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Support for OmniAuth 2.0 series (`omniauth ~> 2.0`, `omniauth-oauth2 ~> 1.7, >= 1.7.1`). (#32, #34)
|
|
9
|
+
- Support for fetching verified user email (`info[:email]`) via LINE's `/oauth2/v2.1/verify` endpoint when `id_token` is present (e.g., with `scope: 'profile openid email'`). (#25, #31)
|
|
10
|
+
- Include `raw_info` in `extra` auth hash (`extra['raw_info']`).
|
|
11
|
+
- GitHub Actions CI workflow for Ruby 3.1, 3.2, 3.3, and 3.4, plus automated RubyGems Trusted Publishing workflow and Dependabot configuration. (#28, #39)
|
|
12
|
+
- Documentation for OmniAuth 2.0 `POST /auth/line` login button, `email` scope, and `bot_prompt` option. (#30, #36)
|
|
13
|
+
- Added `.gitignore` and `LICENSE`. (#15)
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Fixed duplicated `script_name` in `callback_url` under OmniAuth 2.0. (#32, #34)
|
|
17
|
+
- Fixed `options[:client_options][:site]` remaining `'https://api.line.me'` on subsequent login requests after a callback phase. (#8)
|
|
18
|
+
- Replaced `JSON.load` with `JSON.parse` for safer parsing of API responses.
|
|
19
|
+
|
|
20
|
+
## [0.1.0] - 2021-02-11
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- Override `callback_url` to fix `redirect_uri` mismatch with `omniauth-oauth2` >= 1.4.0. (#26)
|
|
24
|
+
|
|
25
|
+
## [0.0.5] - 2020-09-09
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- Updated `json` dependency (`>= 2.3.0`), `bundler` (`~> 2.0`), and loosened `omniauth-oauth2` (`~> 1.3`). (#21)
|
|
29
|
+
- Updated for LINE Login v2.1 (OpenID Connect). (#7)
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-2026 kazasiki
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# OmniAuth Line
|
|
2
2
|
|
|
3
|
-
This gem contains the
|
|
3
|
+
This gem contains the LINE OAuth2 Strategy for OmniAuth (`>= 2.0`).
|
|
4
4
|
|
|
5
|
-
Supports the OpenID Connect Web Login. Read the
|
|
5
|
+
Supports the OpenID Connect Web Login (LINE Login v2.1). Read the LINE Developers docs for more details: https://developers.line.biz/en/docs/line-login/integrate-line-login/
|
|
6
6
|
|
|
7
7
|
## Using This Strategy
|
|
8
8
|
|
|
@@ -10,6 +10,8 @@ First start by adding this gem to your Gemfile:
|
|
|
10
10
|
|
|
11
11
|
```ruby
|
|
12
12
|
gem 'omniauth-line'
|
|
13
|
+
# For Rails apps with OmniAuth 2.0+, also add CSRF protection:
|
|
14
|
+
gem 'omniauth-rails_csrf_protection'
|
|
13
15
|
```
|
|
14
16
|
|
|
15
17
|
Next, tell OmniAuth about this provider. For a Rails app, your `config/initializers/omniauth.rb` file should look like this:
|
|
@@ -17,11 +19,48 @@ Next, tell OmniAuth about this provider. For a Rails app, your `config/initializ
|
|
|
17
19
|
```ruby
|
|
18
20
|
# PROFILE permission required!!
|
|
19
21
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
|
20
|
-
provider :line,
|
|
22
|
+
provider :line, ENV['LINE_CHANNEL_ID'], ENV['LINE_CHANNEL_SECRET']
|
|
21
23
|
end
|
|
22
24
|
```
|
|
23
25
|
|
|
26
|
+
### Initiating Login (OmniAuth 2.0+)
|
|
27
|
+
|
|
28
|
+
In OmniAuth 2.0+, the request phase requires an HTTP `POST` request with a CSRF token. In Rails, use `button_to` (or `form_with`) with `data: { turbo: false }`:
|
|
29
|
+
|
|
30
|
+
```erb
|
|
31
|
+
<%= button_to 'Log in with LINE', '/auth/line', method: :post, data: { turbo: false } %>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Requesting Email Address
|
|
35
|
+
|
|
36
|
+
If your LINE Login channel has permission to obtain the user's email address, include `email` in the `scope` option:
|
|
37
|
+
|
|
38
|
+
```ruby
|
|
39
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
|
40
|
+
provider :line, ENV['LINE_CHANNEL_ID'], ENV['LINE_CHANNEL_SECRET'],
|
|
41
|
+
scope: 'profile openid email'
|
|
42
|
+
end
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
When an `id_token` is returned by LINE, `omniauth-line` verifies it via LINE's `/oauth2/v2.1/verify` endpoint and sets `info[:email]`.
|
|
46
|
+
|
|
47
|
+
### Adding a LINE Official Account as a Friend (`bot_prompt`)
|
|
48
|
+
|
|
49
|
+
To display an option to add a linked LINE Official Account as a friend during login, pass `bot_prompt` (`normal` or `aggressive`) via `authorize_params`:
|
|
50
|
+
|
|
51
|
+
```ruby
|
|
52
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
|
53
|
+
provider :line, ENV['LINE_CHANNEL_ID'], ENV['LINE_CHANNEL_SECRET'],
|
|
54
|
+
authorize_params: {
|
|
55
|
+
bot_prompt: 'aggressive' # or 'normal'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
See the [LINE documentation on linking a LINE Official Account](https://developers.line.biz/en/docs/line-login/link-a-bot/) for details.
|
|
61
|
+
|
|
24
62
|
## Authentication Hash
|
|
63
|
+
|
|
25
64
|
An example auth hash available in `request.env['omniauth.auth']`:
|
|
26
65
|
|
|
27
66
|
```ruby
|
|
@@ -32,17 +71,25 @@ An example auth hash available in `request.env['omniauth.auth']`:
|
|
|
32
71
|
:name => "yamada tarou",
|
|
33
72
|
:image => "http://dl.profile.line.naver.jp/xxxxx",
|
|
34
73
|
:description => "breakfast now.",
|
|
74
|
+
:email => "tarou@example.com" # Present when 'email' scope is granted
|
|
35
75
|
},
|
|
36
76
|
:credentials => {
|
|
37
77
|
:token => "a1b2c3d4...", # The OAuth 2.0 access token
|
|
38
|
-
:
|
|
78
|
+
:refresh_token => "e5f6g7...",
|
|
79
|
+
:expires_at => 1700000000,
|
|
80
|
+
:expires => true
|
|
39
81
|
},
|
|
40
82
|
:extra => {
|
|
41
|
-
|
|
83
|
+
"raw_info" => {
|
|
84
|
+
"userId" => "a123b4....",
|
|
85
|
+
"displayName" => "yamada tarou",
|
|
86
|
+
"pictureUrl" => "http://dl.profile.line.naver.jp/xxxxx",
|
|
87
|
+
"statusMessage" => "breakfast now."
|
|
88
|
+
}
|
|
42
89
|
}
|
|
43
90
|
}
|
|
44
91
|
```
|
|
45
92
|
|
|
46
93
|
## Supported Rubies
|
|
47
94
|
|
|
48
|
-
OmniAuth Line is tested under
|
|
95
|
+
OmniAuth Line is tested under Ruby 3.1, 3.2, 3.3, and 3.4.
|
|
@@ -13,6 +13,11 @@ module OmniAuth
|
|
|
13
13
|
token_url: '/oauth2/v2.1/token'
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
def request_phase
|
|
17
|
+
options[:client_options][:site] = 'https://access.line.me'
|
|
18
|
+
super
|
|
19
|
+
end
|
|
20
|
+
|
|
16
21
|
# host changed
|
|
17
22
|
def callback_phase
|
|
18
23
|
options[:client_options][:site] = 'https://api.line.me'
|
|
@@ -21,26 +26,59 @@ module OmniAuth
|
|
|
21
26
|
|
|
22
27
|
def callback_url
|
|
23
28
|
# Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7
|
|
24
|
-
options[:callback_url] || (full_host +
|
|
29
|
+
options[:callback_url] || (full_host + callback_path)
|
|
25
30
|
end
|
|
26
|
-
|
|
31
|
+
|
|
27
32
|
uid { raw_info['userId'] }
|
|
28
33
|
|
|
29
34
|
info do
|
|
30
35
|
{
|
|
31
36
|
name: raw_info['displayName'],
|
|
32
37
|
image: raw_info['pictureUrl'],
|
|
33
|
-
description: raw_info['statusMessage']
|
|
38
|
+
description: raw_info['statusMessage'],
|
|
39
|
+
email: email
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
extra do
|
|
44
|
+
{
|
|
45
|
+
'raw_info' => raw_info
|
|
34
46
|
}
|
|
35
47
|
end
|
|
36
48
|
|
|
37
49
|
# Require: Access token with PROFILE permission issued.
|
|
38
50
|
def raw_info
|
|
39
|
-
@raw_info ||= JSON.
|
|
51
|
+
@raw_info ||= JSON.parse(access_token.get('v2/profile').body)
|
|
40
52
|
rescue ::Errno::ETIMEDOUT
|
|
41
53
|
raise ::Timeout::Error
|
|
42
54
|
end
|
|
43
55
|
|
|
56
|
+
def email
|
|
57
|
+
return nil unless id_token
|
|
58
|
+
|
|
59
|
+
@email ||= verify_id_token['email']
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
private
|
|
63
|
+
|
|
64
|
+
def id_token
|
|
65
|
+
return nil unless access_token
|
|
66
|
+
|
|
67
|
+
access_token.params['id_token'] || access_token['id_token']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def verify_id_token
|
|
71
|
+
response = access_token.post(
|
|
72
|
+
'oauth2/v2.1/verify',
|
|
73
|
+
body: {
|
|
74
|
+
id_token: id_token,
|
|
75
|
+
client_id: options.client_id
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
JSON.parse(response.body)
|
|
79
|
+
rescue ::Errno::ETIMEDOUT
|
|
80
|
+
raise ::Timeout::Error
|
|
81
|
+
end
|
|
44
82
|
end
|
|
45
83
|
end
|
|
46
84
|
end
|
data/omniauth-line.gemspec
CHANGED
|
@@ -12,12 +12,14 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
s.summary = s.description
|
|
13
13
|
s.license = "MIT"
|
|
14
14
|
|
|
15
|
+
s.required_ruby_version = ">= 2.7.0"
|
|
16
|
+
|
|
15
17
|
s.files = `git ls-files`.split("\n")
|
|
16
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
17
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
18
19
|
s.require_paths = ["lib"]
|
|
19
20
|
|
|
20
21
|
s.add_dependency 'json', '>= 2.3.0'
|
|
21
|
-
s.add_dependency 'omniauth
|
|
22
|
-
s.
|
|
22
|
+
s.add_dependency 'omniauth', '~> 2.0'
|
|
23
|
+
s.add_dependency 'omniauth-oauth2', '~> 1.7', '>= 1.7.1'
|
|
24
|
+
s.add_development_dependency 'bundler', '>= 2.0'
|
|
23
25
|
end
|
|
@@ -5,7 +5,7 @@ describe OmniAuth::Strategies::Line do
|
|
|
5
5
|
|
|
6
6
|
subject do
|
|
7
7
|
args = ['channel_id', 'secret', @options || {}].compact
|
|
8
|
-
OmniAuth::Strategies::Line.new(*args).tap do |strategy|
|
|
8
|
+
OmniAuth::Strategies::Line.new(nil, *args).tap do |strategy|
|
|
9
9
|
allow(strategy).to receive(:request) {
|
|
10
10
|
request
|
|
11
11
|
}
|
|
@@ -36,7 +36,7 @@ describe OmniAuth::Strategies::Line do
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
it 'should returns the uid' do
|
|
39
|
-
expect(subject.uid).to eq(raw_info_hash['
|
|
39
|
+
expect(subject.uid).to eq(raw_info_hash['userId'])
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
@@ -56,6 +56,39 @@ describe OmniAuth::Strategies::Line do
|
|
|
56
56
|
it 'should returns the description' do
|
|
57
57
|
expect(subject.info[:description]).to eq(raw_info_hash['statusMessage'])
|
|
58
58
|
end
|
|
59
|
+
|
|
60
|
+
it 'returns nil for email when id_token is not present' do
|
|
61
|
+
expect(subject.info[:email]).to be_nil
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
context 'when id_token is present in access_token' do
|
|
65
|
+
let(:response) { double('Response', body: '{"email":"foo@example.com"}') }
|
|
66
|
+
let(:access_token) do
|
|
67
|
+
double('AccessToken', params: { 'id_token' => 'dummy_id_token' })
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
before do
|
|
71
|
+
allow(subject).to receive(:access_token).and_return(access_token)
|
|
72
|
+
allow(access_token).to receive(:post).with(
|
|
73
|
+
'oauth2/v2.1/verify',
|
|
74
|
+
body: { id_token: 'dummy_id_token', client_id: 'channel_id' }
|
|
75
|
+
).and_return(response)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
it 'fetches and returns the email via verify endpoint' do
|
|
79
|
+
expect(subject.info[:email]).to eq('foo@example.com')
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
describe 'extra' do
|
|
85
|
+
before do
|
|
86
|
+
allow(subject).to receive(:raw_info).and_return(raw_info_hash)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it 'includes raw_info' do
|
|
90
|
+
expect(subject.extra).to eq({ 'raw_info' => raw_info_hash })
|
|
91
|
+
end
|
|
59
92
|
end
|
|
60
93
|
|
|
61
94
|
describe 'request_phase' do
|
|
@@ -71,6 +104,30 @@ describe OmniAuth::Strategies::Line do
|
|
|
71
104
|
expect { subject.request_phase }.not_to raise_error
|
|
72
105
|
end
|
|
73
106
|
end
|
|
107
|
+
|
|
108
|
+
it 'resets client_options[:site] to https://access.line.me even after callback_phase' do
|
|
109
|
+
subject.options[:client_options][:site] = 'https://api.line.me'
|
|
110
|
+
allow(subject).to receive(:redirect)
|
|
111
|
+
allow(subject).to receive(:authorize_params).and_return({})
|
|
112
|
+
allow(subject).to receive(:callback_url).and_return('https://example.com/auth/line/callback')
|
|
113
|
+
|
|
114
|
+
subject.request_phase
|
|
115
|
+
expect(subject.options.client_options.site).to eq('https://access.line.me')
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
describe '#callback_url' do
|
|
120
|
+
it 'should return callback url with script_name' do
|
|
121
|
+
base_url = 'https://example.com'
|
|
122
|
+
allow(subject).to receive(:full_host) { base_url }
|
|
123
|
+
allow(subject).to receive(:script_name) { '/v1' }
|
|
124
|
+
expect(subject.send(:callback_url)).to eq "#{base_url}/v1/auth/line/callback"
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
it 'should prefer options[:callback_url] when configured' do
|
|
128
|
+
subject.options[:callback_url] = 'https://custom.example.com/callback'
|
|
129
|
+
expect(subject.send(:callback_url)).to eq 'https://custom.example.com/callback'
|
|
130
|
+
end
|
|
74
131
|
end
|
|
75
132
|
|
|
76
133
|
end
|
|
@@ -79,7 +136,7 @@ private
|
|
|
79
136
|
|
|
80
137
|
def raw_info_hash
|
|
81
138
|
{
|
|
82
|
-
'
|
|
139
|
+
'userId' => 'hoge',
|
|
83
140
|
'displayName' => 'Foo Bar',
|
|
84
141
|
'pictureUrl' => 'http://xxx.com/aaa.jpg',
|
|
85
142
|
'statusMessage' => 'Developer'
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-line
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kazasiki
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: json
|
|
@@ -24,32 +23,52 @@ dependencies:
|
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: 2.3.0
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: omniauth
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '2.0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '2.0'
|
|
27
40
|
- !ruby/object:Gem::Dependency
|
|
28
41
|
name: omniauth-oauth2
|
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
|
30
43
|
requirements:
|
|
31
44
|
- - "~>"
|
|
32
45
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '1.
|
|
46
|
+
version: '1.7'
|
|
47
|
+
- - ">="
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: 1.7.1
|
|
34
50
|
type: :runtime
|
|
35
51
|
prerelease: false
|
|
36
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
53
|
requirements:
|
|
38
54
|
- - "~>"
|
|
39
55
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '1.
|
|
56
|
+
version: '1.7'
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: 1.7.1
|
|
41
60
|
- !ruby/object:Gem::Dependency
|
|
42
61
|
name: bundler
|
|
43
62
|
requirement: !ruby/object:Gem::Requirement
|
|
44
63
|
requirements:
|
|
45
|
-
- - "
|
|
64
|
+
- - ">="
|
|
46
65
|
- !ruby/object:Gem::Version
|
|
47
66
|
version: '2.0'
|
|
48
67
|
type: :development
|
|
49
68
|
prerelease: false
|
|
50
69
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
70
|
requirements:
|
|
52
|
-
- - "
|
|
71
|
+
- - ">="
|
|
53
72
|
- !ruby/object:Gem::Version
|
|
54
73
|
version: '2.0'
|
|
55
74
|
description: OmniAuth strategy for Line
|
|
@@ -59,7 +78,13 @@ executables: []
|
|
|
59
78
|
extensions: []
|
|
60
79
|
extra_rdoc_files: []
|
|
61
80
|
files:
|
|
81
|
+
- ".github/dependabot.yml"
|
|
82
|
+
- ".github/workflows/ci.yml"
|
|
83
|
+
- ".github/workflows/release.yml"
|
|
84
|
+
- ".gitignore"
|
|
85
|
+
- CHANGELOG.md
|
|
62
86
|
- Gemfile
|
|
87
|
+
- LICENSE
|
|
63
88
|
- README.md
|
|
64
89
|
- Rakefile
|
|
65
90
|
- lib/omniauth-line.rb
|
|
@@ -72,7 +97,6 @@ homepage: https://github.com/kazasiki/omniauth-line
|
|
|
72
97
|
licenses:
|
|
73
98
|
- MIT
|
|
74
99
|
metadata: {}
|
|
75
|
-
post_install_message:
|
|
76
100
|
rdoc_options: []
|
|
77
101
|
require_paths:
|
|
78
102
|
- lib
|
|
@@ -80,17 +104,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
80
104
|
requirements:
|
|
81
105
|
- - ">="
|
|
82
106
|
- !ruby/object:Gem::Version
|
|
83
|
-
version:
|
|
107
|
+
version: 2.7.0
|
|
84
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
109
|
requirements:
|
|
86
110
|
- - ">="
|
|
87
111
|
- !ruby/object:Gem::Version
|
|
88
112
|
version: '0'
|
|
89
113
|
requirements: []
|
|
90
|
-
rubygems_version: 3.
|
|
91
|
-
signing_key:
|
|
114
|
+
rubygems_version: 3.6.9
|
|
92
115
|
specification_version: 4
|
|
93
116
|
summary: OmniAuth strategy for Line
|
|
94
|
-
test_files:
|
|
95
|
-
- spec/omniauth/strategies/line_spec.rb
|
|
96
|
-
- spec/spec_helper.rb
|
|
117
|
+
test_files: []
|