omniauth-globalid 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/globalid.rb +21 -1
- data/lib/omniauth-globalid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e1578034a025780ef56592bcfebc4730196eed91c6d0df8c5305dfbd85faf68
|
4
|
+
data.tar.gz: f16903d4578d012ba9debd4cf9b518951a429b44f0f52633077a21057bfe6a0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4271bb18cdcd19796a87b8d0f3d1ae94c4a7b3cc3e1f1a2f9872e99e575e79bc9f0dc19122f98bf6e99e56891754ee656252a6956c957dd88f1729ad0f323da5
|
7
|
+
data.tar.gz: 27a0f3ab4ddbeeeda65920ec376f02271a811cb2f73f65a4d9d9dcc809ab103f03338f9ff0b2abfc25e97e6c46635b2dd508e64fcc4a5dc0b59e837edcf0d252
|
@@ -6,12 +6,32 @@ module OmniAuth
|
|
6
6
|
option :name, "globalid"
|
7
7
|
DEFAULT_SCOPE = "public"
|
8
8
|
|
9
|
-
option :client_options, site: "https://auth.global.id",
|
9
|
+
option :client_options, site: "https://auth.global.id",
|
10
|
+
authorize_url: "/",
|
11
|
+
token_url: "https://api.globalid.net/v1/auth/token"
|
10
12
|
|
11
13
|
# https://github.com/omniauth/omniauth-oauth2/issues/81
|
12
14
|
def callback_url
|
13
15
|
full_host + script_name + callback_path
|
14
16
|
end
|
17
|
+
|
18
|
+
uid { raw_info["gid_uuid"] }
|
19
|
+
|
20
|
+
def raw_info
|
21
|
+
return @raw_info if defined?(@raw_info)
|
22
|
+
result = api_connection.get("/v1/identities/me")
|
23
|
+
@raw_info = JSON.parse(result.body)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def api_connection
|
29
|
+
Faraday.new(url: "https://api.globalid.net") do |conn|
|
30
|
+
conn.headers["Authorization"] = "Bearer #{access_token.token}"
|
31
|
+
conn.headers["Content-Type"] = "application/json"
|
32
|
+
conn.adapter Faraday.default_adapter
|
33
|
+
end
|
34
|
+
end
|
15
35
|
end
|
16
36
|
end
|
17
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-globalid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Herr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|