keycloak 3.1.0 → 3.2.2

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: 31c0cf08f09237855b198e4128d3e8b6419d3a404fafd413c2043015a6d7a4c9
4
- data.tar.gz: f2265af7c22257d307b1bfe6bea0fca0db01dc5d8ecb6dd9a0374685c75821a8
3
+ metadata.gz: 97221b6b086ebc94abf5549577c340c8cc17d41c53136f234e3847a0b9d49fc6
4
+ data.tar.gz: 13af37a7655bfe7914a38c34324eb5bfbc83ca1308329e643d37f41a3520dc74
5
5
  SHA512:
6
- metadata.gz: b341ebe39b5cf767604c7b673300b1b14a27dac0f34d15c5afa7edf99d705d7cf3c3970345de2d9dbb4a4093ee1282b101a57840a0273e02386b9d317fb14510
7
- data.tar.gz: cab5a14532198339f832690908a44dacea2072765603f770bfe103e07680e051a717438266616edda967b1902bd17ca271690536a0faa9459051b6af3c079733
6
+ metadata.gz: 724c8d3588d730a62d92f7621a8bfed2e7011788ef0fd3a0b480b180635e06c3976a6df6cdee0da02b1acb99eea3478ed372a2c962134f16630ca345862c6a23
7
+ data.tar.gz: 664e992c34d3eda490a728f98994049855feefcf92953c3d1d4cfe39b6c9e8f0740af8a98d6324eb78bf47a2355be5b5dd44764c92591e756ec92143c74eea82
data/Gemfile.lock CHANGED
@@ -1,55 +1,57 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- keycloak (3.0.0)
5
- json
6
- jwt
7
- rest-client
4
+ keycloak (3.2.2)
5
+ json (= 2.6.2)
6
+ jwt (= 2.4.1)
7
+ rest-client (= 2.1.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- diff-lcs (1.3)
13
- domain_name (0.5.20180417)
12
+ diff-lcs (1.5.0)
13
+ domain_name (0.5.20190701)
14
14
  unf (>= 0.0.5, < 1.0.0)
15
- http-cookie (1.0.3)
15
+ http-accept (1.7.0)
16
+ http-cookie (1.0.5)
16
17
  domain_name (~> 0.5)
17
- json (2.2.0)
18
- jwt (2.2.1)
19
- mime-types (3.2.2)
18
+ json (2.6.2)
19
+ jwt (2.4.1)
20
+ mime-types (3.4.1)
20
21
  mime-types-data (~> 3.2015)
21
- mime-types-data (3.2019.0331)
22
+ mime-types-data (3.2022.0105)
22
23
  netrc (0.11.0)
23
- rake (10.5.0)
24
- rest-client (2.0.2)
24
+ rake (13.0.6)
25
+ rest-client (2.1.0)
26
+ http-accept (>= 1.7.0, < 2.0)
25
27
  http-cookie (>= 1.0.2, < 2.0)
26
28
  mime-types (>= 1.16, < 4.0)
27
29
  netrc (~> 0.8)
28
- rspec (3.7.0)
29
- rspec-core (~> 3.7.0)
30
- rspec-expectations (~> 3.7.0)
31
- rspec-mocks (~> 3.7.0)
32
- rspec-core (3.7.1)
33
- rspec-support (~> 3.7.0)
34
- rspec-expectations (3.7.0)
30
+ rspec (3.11.0)
31
+ rspec-core (~> 3.11.0)
32
+ rspec-expectations (~> 3.11.0)
33
+ rspec-mocks (~> 3.11.0)
34
+ rspec-core (3.11.0)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-expectations (3.11.0)
35
37
  diff-lcs (>= 1.2.0, < 2.0)
36
- rspec-support (~> 3.7.0)
37
- rspec-mocks (3.7.0)
38
+ rspec-support (~> 3.11.0)
39
+ rspec-mocks (3.11.1)
38
40
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.7.0)
40
- rspec-support (3.7.1)
41
+ rspec-support (~> 3.11.0)
42
+ rspec-support (3.11.0)
41
43
  unf (0.1.4)
42
44
  unf_ext
43
- unf_ext (0.0.7.6)
45
+ unf_ext (0.0.8.2)
44
46
 
45
47
  PLATFORMS
46
- ruby
48
+ x86_64-linux
47
49
 
48
50
  DEPENDENCIES
49
- bundler (~> 1.15)
51
+ bundler (~> 2.3)
50
52
  keycloak!
51
- rake (~> 10.0)
52
- rspec (~> 3.0)
53
+ rake (~> 13.0)
54
+ rspec (~> 3.7)
53
55
 
54
56
  BUNDLED WITH
55
- 1.16.2
57
+ 2.3.7
data/README.md CHANGED
@@ -152,7 +152,10 @@ To authenticate the users of your application using a template configured in Key
152
152
  Keycloak::Client.get_token_by_code(code, redirect_uri, client_id = '', secret = '')
153
153
  ```
154
154
 
155
- When using the `Keycloak::Client.url_login_redirect` method to get a `code`, pass it as a parameter in this method so that Keycloak returns a token, thus logging the user in the application. The second parameter (`redirect_uri`) must be passed so that when a token is made available, Keycloak redirects to the url informed.
155
+ When using the `Keycloak::Client.url_login_redirect` method to get a `code`, pass it as a parameter in this method so that Keycloak returns a token, thus logging the user in the application. The second parameter (`redirect_uri`) must be the same one used in the call for `Keycloak::Client.url_login_redirect(redirect_uri, response_type = 'code')`.
156
+
157
+ > If `redirect_uri` are not equal on both calls, `Keycloak::Client.url_login_redirect` and `Keycloak::Client.get_token_by_code` you will receive the following error:
158
+ > `{"error":"invalid_grant","error_description":"Incorrect redirect_uri"}`
156
159
 
157
160
 
158
161
  ```ruby
data/keycloak.gemspec CHANGED
@@ -30,10 +30,10 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_development_dependency "bundler", "~> 1.15"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_development_dependency "rspec", "~> 3.0"
33
+ spec.add_development_dependency "bundler", "~> 2.3"
34
+ spec.add_development_dependency "rake", "~> 13.0"
35
+ spec.add_development_dependency "rspec", "~> 3.7"
36
36
  spec.add_runtime_dependency "rest-client", "2.1.0"
37
- spec.add_runtime_dependency "jwt", "2.2.1"
38
- spec.add_runtime_dependency "json", "2.3.0"
37
+ spec.add_runtime_dependency "jwt", "2.4.1"
38
+ spec.add_runtime_dependency "json", "2.6.2"
39
39
  end
@@ -10,3 +10,7 @@ Keycloak.realm = ''
10
10
  Keycloak.auth_server_url = ''
11
11
  # The introspect of the token will be executed every time the Keycloak::Client.has_role? method is invoked, if this setting is set to true.
12
12
  Keycloak.validate_token_when_call_has_role = false
13
+ # secret (only if the installation file is not present)
14
+ Keycloak.secret = ''
15
+ # resource (client_id, only if the installation file is not present)
16
+ Keycloak.resource = ''
@@ -1,3 +1,3 @@
1
1
  module Keycloak
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.2.2'.freeze
3
3
  end
data/lib/keycloak.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'keycloak/version'
2
4
  require 'rest-client'
3
5
  require 'json'
@@ -16,7 +18,8 @@ module Keycloak
16
18
  class << self
17
19
  attr_accessor :proxy, :generate_request_exception, :keycloak_controller,
18
20
  :proc_cookie_token, :proc_external_attributes,
19
- :realm, :auth_server_url, :validate_token_when_call_has_role
21
+ :realm, :auth_server_url, :validate_token_when_call_has_role,
22
+ :secret, :resource
20
23
  end
21
24
 
22
25
  def self.explode_exception
@@ -345,6 +348,8 @@ module Keycloak
345
348
 
346
349
  @realm = Keycloak.realm
347
350
  @auth_server_url = Keycloak.auth_server_url
351
+ @client_id = Keycloak.resource
352
+ @secret = Keycloak.secret
348
353
  end
349
354
  openid_configuration
350
355
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keycloak
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Portugues
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-26 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: '2.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '3.7'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '3.7'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rest-client
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,29 +72,29 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 2.2.1
75
+ version: 2.4.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 2.2.1
82
+ version: 2.4.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: json
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 2.3.0
89
+ version: 2.6.2
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 2.3.0
97
- description:
96
+ version: 2.6.2
97
+ description:
98
98
  email:
99
99
  - g_portugues@hotmail.com
100
100
  executables: []
@@ -124,7 +124,7 @@ homepage: https://github.com/imagov/keycloak.git
124
124
  licenses:
125
125
  - MIT
126
126
  metadata: {}
127
- post_install_message:
127
+ post_install_message:
128
128
  rdoc_options: []
129
129
  require_paths:
130
130
  - lib
@@ -139,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.0.3
143
- signing_key:
142
+ rubygems_version: 3.3.7
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: Add authentication to applications and secure services with Keycloak
146
146
  test_files: []