omniauth-line-notify 0.2.0 → 0.2.1
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.ja.md +63 -0
- data/README.md +5 -1
- data/bin/console +1 -1
- data/lib/omniauth-line-notify/version.rb +1 -1
- data/lib/omniauth/strategies/line-notify.rb +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36cec44b0004a9edd9b503c2e61248c3560676d9
|
4
|
+
data.tar.gz: b90b026b3e8f468f3fe700104ed6fc34c46f50e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b39dd75a72c85db8dad68ebe8da189f2b35e78fa126fba163a3f8d5e221a8c037d0cfef35396c17ed0945aa6d5a3339f89da1f3fd04767d9d0f97045daf43d2f
|
7
|
+
data.tar.gz: b7f63ae9d12b01bcc6c7b579c6b888d4bc0382da6acc2ca8c4af71c743d96ef0f4cf870a078d7ab58c765a6ef55d8424a5fceb0f8cd015dcb0ffaf181c62a2ad
|
data/README.ja.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# OmniAuth::Line::Notify
|
2
|
+
|
3
|
+
[英語版 README](https://github.com/blueplanet/omniauth-line-notify/blob/master/README.md)
|
4
|
+
|
5
|
+
LINE Notify の OmniAuth ストラテジー.
|
6
|
+
OAuth 2.0でのサーバーサイド認証フローサポート。他の情報は LINE Notify のドキュメントをご参照ください: https://notify-bot.line.me/static/pdf/line-notify-api_ja.pdf
|
7
|
+
|
8
|
+
## インストール
|
9
|
+
|
10
|
+
**ワーニング: 今現在(2016/10/15)、 LINE Notify は `uid` を取得できないので、ログイン機能では使えません、ユーザに通知を送るケースだけ使える**
|
11
|
+
|
12
|
+
Gemfile に下記の行を追加
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'omniauth-line-notify'
|
16
|
+
```
|
17
|
+
|
18
|
+
そして下記を実行
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
または、手動でインストール
|
23
|
+
|
24
|
+
$ gem install omniauth-line-notify
|
25
|
+
|
26
|
+
## 使い方
|
27
|
+
|
28
|
+
OmniAuth::Strategies::LineNotify はシンプルなRackミードルウェアである。他の情報は https://github.com/intridea/omniauth を参照ください。
|
29
|
+
|
30
|
+
ミードルウェアを Rails アプリケーションに追加する config/initializers/omniauth.rb:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
34
|
+
provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
または、devise の設定ファイルで追加する
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
config.omniauth :line_notify, ENV['LINE_NOTIFY_CLIEDNT_ID'], ENV['LINE_NOTIFY_APP_SECRET'], scope: 'notify'
|
42
|
+
```
|
43
|
+
|
44
|
+
## 認証のHash情報
|
45
|
+
|
46
|
+
認証後の request.env['omniauth.auth'] は下記のようになる。
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
{
|
50
|
+
provider: 'line_notify',
|
51
|
+
uid: nil,
|
52
|
+
info: {},
|
53
|
+
credentials: {
|
54
|
+
token: 'ABCDEF...', # OAuth 2.0 のアクセストークン
|
55
|
+
expires: false
|
56
|
+
},
|
57
|
+
extra: {}
|
58
|
+
}
|
59
|
+
```
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
バグとアドバイスは GitHub at https://github.com/blueplanet/omniauth-line-notify でお願いします。
|
data/README.md
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# OmniAuth::Line::Notify
|
2
|
+
|
3
|
+
[Japanese README](https://github.com/blueplanet/omniauth-line-notify/blob/master/README.ja.md)
|
2
4
|
|
3
5
|
LINE Notify Strategy for OmniAuth.
|
4
6
|
Supports OAuth 2.0 server-side flows. Read the LINE Notify docs for more details: https://notify-bot.line.me/static/pdf/line-notify-api.pdf
|
5
7
|
|
6
8
|
## Installation
|
7
9
|
|
10
|
+
**Warning: Now LINE Notify can`t get the uid, so you can't use the LINE Notify in user login feture, only send notify**
|
11
|
+
|
8
12
|
Add this line to your application's Gemfile:
|
9
13
|
|
10
14
|
```ruby
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
|
-
require "omniauth/line
|
4
|
+
require "omniauth/strategies/line-notify"
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -6,7 +6,7 @@ module OmniAuth
|
|
6
6
|
class LineNotify < OmniAuth::Strategies::OAuth2
|
7
7
|
option :name, 'line_notify'
|
8
8
|
|
9
|
-
option :client_options, {:site => 'https://notify-bot.line.me
|
9
|
+
option :client_options, {:site => 'https://notify-bot.line.me',
|
10
10
|
:authorize_url => '/oauth/authorize',
|
11
11
|
:token_url => '/oauth/token',
|
12
12
|
:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
|
@@ -17,6 +17,8 @@ module OmniAuth
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
protected
|
21
|
+
|
20
22
|
def callback_url
|
21
23
|
full_host + script_name + callback_path
|
22
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-line-notify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- blueplanet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- ".rspec"
|
66
66
|
- ".travis.yml"
|
67
67
|
- Gemfile
|
68
|
+
- README.ja.md
|
68
69
|
- README.md
|
69
70
|
- Rakefile
|
70
71
|
- bin/console
|