omniauth-globalid 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/omniauth/globalid/vault.rb +6 -4
- data/lib/omniauth/globalid/version.rb +1 -1
- data/lib/omniauth/strategies/globalid.rb +1 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee817323908f8a4bda10bb5e71c86bc5e7900d6d63eb71772de5c3c700ce1714
|
4
|
+
data.tar.gz: c0318012c3dace7a58f3b607d4c3de8ce1e0ab18abf505031986fc02a82d7968
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7af4b3659f7b945c60f1816a0514763eda8df43467a7075b4984dae03c017ea55f133346d8e3537a739ac223ac8cda2925d788e85100e720616b7e6efb1366cd
|
7
|
+
data.tar.gz: 4d39d5a172625f1d8446a8f9ff2a3646e76da0c0a35a84451e9990ed0fa99e29e212133490c8f92610187437a3f801905acbb67b6075fa3538e03289c6de38b7
|
data/README.md
CHANGED
@@ -154,10 +154,10 @@ _If you have a functioning Omniauth installation this will happen in your contro
|
|
154
154
|
|
155
155
|
|
156
156
|
```ruby
|
157
|
-
|
157
|
+
client_credentials_token_params = { client_id: ENV["GLOBALID_CLIENT_ID"], client_secret: ENV["GLOBALID_CLIENT_SECRET"], grant_type: "authorization_code", code: code, redirect_uri: ENV["REDIRECT_URL"], acrc_id: ENV["ACRC_ID"] }
|
158
158
|
token_response = Faraday.new(url: token_url).post do |req|
|
159
|
-
req.headers["Content-Type"] = "application/
|
160
|
-
req.body =
|
159
|
+
req.headers["Content-Type"] = "application/json"
|
160
|
+
req.body = client_credentials_token_params.to_json
|
161
161
|
end
|
162
162
|
```
|
163
163
|
|
@@ -265,8 +265,8 @@ _You can determine if you need to refresh the access token if the expiration tim
|
|
265
265
|
refresh_token = "70165f183e7efee2b298302bcaea5276" # Replace with the actual code you have
|
266
266
|
refresh_params = { client_id: ENV["GLOBALID_CLIENT_ID"], redirect_uri: ENV["REDIRECT_URL"], grant_type: "refresh_token", refresh_token: refresh_token }
|
267
267
|
response = Faraday.new(url: token_url).post do |req|
|
268
|
-
req.headers["Content-Type"] = "application/
|
269
|
-
req.body =
|
268
|
+
req.headers["Content-Type"] = "application/json"
|
269
|
+
req.body = refresh_params.to_json
|
270
270
|
end
|
271
271
|
```
|
272
272
|
|
@@ -4,13 +4,14 @@ module OmniAuth
|
|
4
4
|
module Globalid
|
5
5
|
class Vault
|
6
6
|
def initialize(openid_token: nil, token_url: nil, client_id: nil, client_secret: nil,
|
7
|
-
redirect_uri: nil, private_key: nil, private_key_pass: nil)
|
7
|
+
redirect_uri: nil, private_key: nil, private_key_pass: nil, acrc_id: nil)
|
8
8
|
@openid_token = openid_token
|
9
9
|
# TODO: Figure out a cleaner way to implement this!
|
10
|
-
@token_url = token_url || "https://api.
|
10
|
+
@token_url = token_url || "https://api.global.id/v1/auth/token"
|
11
11
|
@client_id = client_id || ENV["GLOBALID_CLIENT_ID"]
|
12
12
|
@client_secret = client_secret || ENV["GLOBALID_CLIENT_SECRET"]
|
13
13
|
@redirect_uri = redirect_uri || ENV["GLOBALID_REDIRECT_URL"]
|
14
|
+
@acrc_id = acrc_id || ENV["ACRC_ID"]
|
14
15
|
# Clean up the private key in case environmental variables were extra escaped
|
15
16
|
private_key ||= ENV["GLOBALID_PRIVATE_KEY"].gsub("\\n", "\n").gsub("\"", "")
|
16
17
|
private_key_pass ||= ENV["GLOBALID_PRIVATE_KEY_PASS"]
|
@@ -62,10 +63,11 @@ module OmniAuth
|
|
62
63
|
client_secret: @client_secret,
|
63
64
|
redirect_uri: @redirect_uri,
|
64
65
|
grant_type: "client_credentials",
|
66
|
+
acrc_id: @acrc_id
|
65
67
|
}
|
66
68
|
client_credentials_response = Faraday.new(url: @token_url).post do |req|
|
67
|
-
req.headers["Content-Type"] = "application/
|
68
|
-
req.body =
|
69
|
+
req.headers["Content-Type"] = "application/json"
|
70
|
+
req.body = client_credentials_token_params.to_json
|
69
71
|
end
|
70
72
|
JSON.parse(client_credentials_response.body)["access_token"] # this is the only part of the client_credentials_response we use
|
71
73
|
end
|
@@ -89,6 +89,7 @@ module OmniAuth
|
|
89
89
|
token_url: options[:token_url],
|
90
90
|
client_id: options[:client_id],
|
91
91
|
client_secret: options[:client_secret],
|
92
|
+
acrc_id: options[:acrc_id],
|
92
93
|
redirect_uri: options[:redirect_uri],
|
93
94
|
private_key: options[:private_key],
|
94
95
|
private_key_pass: options[:private_key_pass])
|
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.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Herr
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '12.0'
|
97
97
|
description: OmniAuth strategy for GlobaliD
|
98
|
-
email:
|
98
|
+
email:
|
99
99
|
executables: []
|
100
100
|
extensions: []
|
101
101
|
extra_rdoc_files: []
|
@@ -117,7 +117,7 @@ homepage: https://gitlab.com/globalid/opensource/omniauth-globalid
|
|
117
117
|
licenses:
|
118
118
|
- ISC
|
119
119
|
metadata: {}
|
120
|
-
post_install_message:
|
120
|
+
post_install_message:
|
121
121
|
rdoc_options: []
|
122
122
|
require_paths:
|
123
123
|
- lib
|
@@ -132,9 +132,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
rubyforge_project:
|
136
|
-
rubygems_version: 2.7.
|
137
|
-
signing_key:
|
135
|
+
rubyforge_project:
|
136
|
+
rubygems_version: 2.7.6.2
|
137
|
+
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: OmniAuth strategy for GlobaliD
|
140
140
|
test_files: []
|