omniauth-globalid 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09664b26f11207b69b017e70d168614cabab576a179c53ff208bf8a74a1696a7'
4
- data.tar.gz: c0e9257def49062aef8e9b34bdcd14e520aec23b50ddc7393edcf77965cd9e46
3
+ metadata.gz: ee817323908f8a4bda10bb5e71c86bc5e7900d6d63eb71772de5c3c700ce1714
4
+ data.tar.gz: c0318012c3dace7a58f3b607d4c3de8ce1e0ab18abf505031986fc02a82d7968
5
5
  SHA512:
6
- metadata.gz: 3aaf1e094e8fd1322c111d76e1ecbdde70fdb3b460d3c50956e2bac89838d7491b483e882c17789b9ee0dd782d0aee4c98c6268485fc09fe320fb5dd0558bfb2
7
- data.tar.gz: d13997f78247c117873e8874c58894f86e5297d9b13127f8656a2336bdfabba2135c2281a0958976f5d229614529d0bc782a0ccbdc3f09507694400a7dabd216
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
- authorization_code_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"] }
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/x-www-form-urlencoded"
160
- req.body = URI.encode_www_form(authorization_code_token_params)
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/x-www-form-urlencoded"
269
- req.body = URI.encode_www_form(refresh_params)
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.globalid.net/v1/auth/token"
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/x-www-form-urlencoded"
68
- req.body = URI.encode_www_form(client_credentials_token_params)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module Globalid
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  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
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: 2019-11-20 00:00:00.000000000 Z
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.9
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: []