omniauth-myadventist 0.1.2 → 0.1.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 +10 -0
- data/lib/omniauth-myadventist/version.rb +1 -1
- data/lib/omniauth/strategies/myadventist.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d64c37a0149cee51d48ffb38b74619c9d5e7db0
|
|
4
|
+
data.tar.gz: 6cbcefcd8a60c7030ccf93a4b0f59b7487196931
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9346d139e8bd7cc57d86c99bb9c372f3cebad67963da6b74d31f6d92c78e9314a5f237045aef3d7dcf64fabe4e48eb492d43e06b6ae76b62a0cddeb4a17b9c77
|
|
7
|
+
data.tar.gz: 533f70c4ee57685af93e17aaa302d5626cddc4632f19abf800eefca134b9bdc5fe034e6e01af34f063d3fb22e111cf29b408c660334a0b36a64a788438abde6d
|
data/README.md
CHANGED
|
@@ -27,6 +27,16 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
|
|
27
27
|
end
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
To use https://test.myadventist.org you can override the client site:
|
|
31
|
+
|
|
32
|
+
```ruby
|
|
33
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
|
34
|
+
client_options = {}
|
|
35
|
+
client_options[:site] = 'https://test.myadventist.org.au' unless Rails.env.production?
|
|
36
|
+
provider :myadventist, Rails.application.secrets.myadventist_client_key, Rails.application.secrets.myadventist_client_secret, client_options: client_options
|
|
37
|
+
end
|
|
38
|
+
```
|
|
39
|
+
|
|
30
40
|
A callback URL also needs to be added to routes.rb The route can point to any controller action of your choice.
|
|
31
41
|
|
|
32
42
|
```ruby
|
|
@@ -6,9 +6,10 @@ module OmniAuth
|
|
|
6
6
|
|
|
7
7
|
option :name, 'myadventist'
|
|
8
8
|
option :client_options, {
|
|
9
|
-
site: 'https://
|
|
9
|
+
site: 'https://myadventist.org.au',
|
|
10
10
|
authorize_url: '/oauth/authorize',
|
|
11
|
-
token_url: '/oauth/gettoken'
|
|
11
|
+
token_url: '/oauth/gettoken',
|
|
12
|
+
info_url: '/oauth/userinfo'
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
uid { raw_info['UserId'] }
|
|
@@ -23,7 +24,7 @@ module OmniAuth
|
|
|
23
24
|
end
|
|
24
25
|
|
|
25
26
|
def raw_info
|
|
26
|
-
@raw_info ||= access_token.post(
|
|
27
|
+
@raw_info ||= access_token.post(client.site + client.options[:info_url], params: raw_info_params).parsed || {}
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
def raw_info_params
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-myadventist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dan Lewis
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: omniauth-oauth2
|