omniauth-protons 0.2.2 → 0.4
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/.gitignore +3 -0
- data/lib/omniauth/protons/version.rb +1 -1
- data/lib/omniauth/strategies/protons.rb +18 -7
- data/lib/omniauth-protons.rb +1 -1
- 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: af9f64b311700fbb0cef815b8845d74aba16d504
|
|
4
|
+
data.tar.gz: 5f40b5f35f79bb620b6b1740e2d3bc3dcac12a48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bfbf21ac2a8934f9b159697787bba52738a4d51264ff5bd136ab81ab1497a81c493b583b863762a74c12313a53f156cde00bc6a795d72be257dca05bb6b7af47
|
|
7
|
+
data.tar.gz: c37eac4153c55fb2a620370d7a95c450da84c4a739c1667a9002e2afce6208ddd7b7e01c6c37882647e53d25dcddb39cc8a782a9d332c32620a4d164308cc0e5
|
data/.gitignore
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
require 'omniauth/strategies/oauth2'
|
|
2
2
|
|
|
3
|
+
MAIN_DOMAIN = Rails.env.development? ? 'http://8protons.dev' : 'https://8protons.com'
|
|
4
|
+
API_DOMAIN = Rails.env.development? ? 'http://api8p.com' : 'https://api8p.com'
|
|
5
|
+
|
|
3
6
|
module OmniAuth
|
|
4
7
|
module Strategies
|
|
5
8
|
# Authentication strategy for connecting with APIs constructed using
|
|
@@ -12,23 +15,31 @@ module OmniAuth
|
|
|
12
15
|
option :name, :protons
|
|
13
16
|
|
|
14
17
|
option :client_options, {
|
|
15
|
-
|
|
16
|
-
:
|
|
18
|
+
site: MAIN_DOMAIN,
|
|
19
|
+
token_url: "#{API_DOMAIN}/oauth2/tokens",
|
|
20
|
+
#authorize_url: '/oauth/auth'
|
|
17
21
|
}
|
|
18
22
|
|
|
19
|
-
uid { raw_info[
|
|
23
|
+
uid { raw_info['id'] }
|
|
20
24
|
|
|
21
25
|
info do
|
|
22
26
|
{
|
|
23
|
-
:
|
|
24
|
-
:
|
|
25
|
-
:
|
|
27
|
+
name: raw_info['fields']['display_name'],
|
|
28
|
+
email: raw_info['fields']['email'],
|
|
29
|
+
nickname: raw_info['fields']['username']
|
|
30
|
+
#:gravatar_hash => raw_info['fields']['gravatar_hash']
|
|
26
31
|
# and anything else you want to return to your API consumers
|
|
27
32
|
}
|
|
28
33
|
end
|
|
29
34
|
|
|
35
|
+
extra do
|
|
36
|
+
{
|
|
37
|
+
'raw_info' => raw_info
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
30
41
|
def raw_info
|
|
31
|
-
@raw_info ||= access_token.get(
|
|
42
|
+
@raw_info ||= access_token.get("#{API_DOMAIN}/base/me").parsed
|
|
32
43
|
end
|
|
33
44
|
end # Protons
|
|
34
45
|
end
|
data/lib/omniauth-protons.rb
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require
|
|
1
|
+
require 'omniauth/protons/version'
|
|
2
2
|
require 'omniauth/strategies/protons'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-protons
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: '0.4'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anthony Sekatski
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-01-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: omniauth-oauth2
|