omniauth-wechat-oauth2 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +44 -1
- data/lib/omniauth-wechat-oauth2.rb +1 -2
- data/lib/omniauth/strategies/wechat.rb +1 -0
- data/lib/omniauth/wechat.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6887df3d9cb9e1d0af5f77a80ceb353ed99e45c4aded5802b94f8ff06c2b44b7
|
4
|
+
data.tar.gz: 45081ea29f1423808a236d5d708ac21b0b76aa86fa6032add3f06de1b1251168
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91ca3a9a3ff98631767e7f54f16206a08ca488fe5a0a24709ad9c8f07e4e3a1483960326a256f7b36acaefae293f01e2cd57a672d9fe3d69205bc3d3be575a51
|
7
|
+
data.tar.gz: 7a0d38a8a9e51213e3d7981a45b599cc12b5f35ce8f85da86e04acb9c5b2b8c91084c6971beb1fe87ad834376e03875c94566f8725ad1cadc7583fc680a34a13
|
data/README.md
CHANGED
@@ -14,7 +14,8 @@ Wechat OAuth2 Strategy for OmniAuth 1.0.
|
|
14
14
|
|
15
15
|
You need to get a wechat API key at: https://mp.weixin.qq.com
|
16
16
|
|
17
|
-
Wechat oauth2 specification can be found at: https://mp.weixin.qq.com/wiki/index.php?title=网页授权获取用户基本信息
|
17
|
+
* Wechat oauth2 specification can be found at: https://mp.weixin.qq.com/wiki/index.php?title=网页授权获取用户基本信息
|
18
|
+
* Wechat Qiye oauth2 specification can be found at: http://qydev.weixin.qq.com/wiki/index.php?title=OAuth验证接口
|
18
19
|
|
19
20
|
## Installation
|
20
21
|
|
@@ -90,6 +91,48 @@ Here's an example of an authentication hash available in the callback by accessi
|
|
90
91
|
}
|
91
92
|
```
|
92
93
|
|
94
|
+
## Wechat Qiye OAuth2
|
93
95
|
|
96
|
+
Wechat Qiey usage and configuration are the same with normal account above.
|
94
97
|
|
98
|
+
```ruby
|
99
|
+
config.omniauth :wechat_qiye, ENV["WECHAT_APP_ID"], ENV["WECHAT_APP_SECRET"],
|
100
|
+
:authorize_params => {:scope => "snsapi_base"}
|
101
|
+
```
|
95
102
|
|
103
|
+
Auth hash `request.env["omniauth.auth"]`
|
104
|
+
|
105
|
+
```ruby
|
106
|
+
{
|
107
|
+
:provider => "wechat_qiye",
|
108
|
+
:uid => "123456789",
|
109
|
+
:info => {
|
110
|
+
userid: "userid",
|
111
|
+
name: "name",
|
112
|
+
department: [2],
|
113
|
+
gender: "1",
|
114
|
+
weixinid: "weixinid",
|
115
|
+
avatar: "avatar",
|
116
|
+
status: 1,
|
117
|
+
extattr: {"foo" => "bar"}
|
118
|
+
},
|
119
|
+
:credentials => {
|
120
|
+
:token => "token",
|
121
|
+
:refresh_token => "another_token",
|
122
|
+
:expires_at => 7200,
|
123
|
+
:expires => true
|
124
|
+
},
|
125
|
+
:extra => {
|
126
|
+
:raw_info => {
|
127
|
+
userid: "userid",
|
128
|
+
name: "name",
|
129
|
+
department: [2],
|
130
|
+
gender: "1",
|
131
|
+
weixinid: "weixinid",
|
132
|
+
avatar: "avatar",
|
133
|
+
status: 1,
|
134
|
+
extattr: {"foo" => "bar"}}
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
```
|
@@ -1,2 +1 @@
|
|
1
|
-
require "omniauth/
|
2
|
-
require "omniauth/strategies/wechat_qiye"
|
1
|
+
require "omniauth/wechat"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-wechat-oauth2
|
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
|
- Alex Hu
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-06-
|
13
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: omniauth
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/omniauth-wechat-oauth2.rb
|
69
69
|
- lib/omniauth/strategies/wechat.rb
|
70
70
|
- lib/omniauth/strategies/wechat_qiye.rb
|
71
|
+
- lib/omniauth/wechat.rb
|
71
72
|
homepage: https://github.com/nevermin/omniauth-wechat-oauth2
|
72
73
|
licenses:
|
73
74
|
- MIT
|