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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7342b0ff250e325c66a98a05586efb91dde15c23ca0a8ebceeead269ee934d0e
4
- data.tar.gz: fd2d78991655ecbbcda69962efa68c6e03aceec6a00a8a34c3f0e88b86738352
3
+ metadata.gz: 3e1578034a025780ef56592bcfebc4730196eed91c6d0df8c5305dfbd85faf68
4
+ data.tar.gz: f16903d4578d012ba9debd4cf9b518951a429b44f0f52633077a21057bfe6a0b
5
5
  SHA512:
6
- metadata.gz: '0293280f9cf661f5d5802f0c42b0603ef9b5293350fa0b217f4fb9ad3e4693a9e453fa058ce2429c62762f7d97384cbc64018b3aed227a4861db045cdc76db1b'
7
- data.tar.gz: 68010d3e326bf117d1f0ee9d45356c1fd498f9fbe0338682e68daf4033ba2921a6bbba05951cd771e162de56ddc5b0a05932582e83a14b86ced6344458589bb3
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", authorize_url: "/"
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
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Globalid
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  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
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-24 00:00:00.000000000 Z
11
+ date: 2019-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth