omniauth-keycloak 1.1.0 → 1.2.0

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: 04fa7b74d74eb9db8aed382ace2d55315a3ec12e3cd3a280b795cec1ec4ce705
4
- data.tar.gz: 7387598e991f95d589dcb27e8ec05096b21541a0199acd099987c8c87caef4f8
3
+ metadata.gz: 6f523d3b03c2258b9b49ca70dd94a02e9104de24a6148ee2d0018c9d3301ffe0
4
+ data.tar.gz: 820eaba1eb35fce32c80a82293ab58ba1c154e307b191cce0b6a37b5888412d0
5
5
  SHA512:
6
- metadata.gz: 85e9f1ae17b31739d6dd92bfe74b2d6590f8165e13b6f3c2aaa8bf169c39cc9392c44dad413a722fdbcd6f510bbaf28dc41a5ca444eac9fa9014978ead7b097f
7
- data.tar.gz: 921a82a88060f829ccba8e761984c245110b664dc7914910fa23f46f1c1f6c6ba30a1124cb5a33975475894ac7b061e9bb4791b1052178c5fe4fcd9cfb01a1f0
6
+ metadata.gz: de576c60d232f49150b0923ec1496c1e6ffdfafdb0fa3a85e3aa17d08952faacfd955a66d292dff352740965599720e645d3866b9d39f364d141bf686445a115
7
+ data.tar.gz: cdf8238793033678b6a348b11111d95ea5449b61d50a63fc1b109e302d4a2616fb0e979acbdef33e5709dd0c0eee6481c9225bba57f7dbaae4a9b42688478535
@@ -1,59 +1,60 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-keycloak (1.0.1)
5
- json-jwt (~> 1.9.4)
6
- omniauth (~> 1.8.1)
7
- omniauth-oauth2 (~> 1.5.0)
4
+ omniauth-keycloak (1.2.0)
5
+ json-jwt (~> 1.12)
6
+ omniauth (~> 1.9.0)
7
+ omniauth-oauth2 (~> 1.6.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (5.2.1)
12
+ activesupport (6.0.3.1)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
+ zeitwerk (~> 2.2, >= 2.2.2)
17
18
  addressable (2.5.2)
18
19
  public_suffix (>= 2.0.2, < 4.0)
19
20
  aes_key_wrap (1.0.1)
20
- bindata (2.4.4)
21
- concurrent-ruby (1.1.3)
21
+ bindata (2.4.7)
22
+ concurrent-ruby (1.1.6)
22
23
  crack (0.4.3)
23
24
  safe_yaml (~> 1.0.0)
24
25
  diff-lcs (1.3)
25
26
  docile (1.3.1)
26
- faraday (0.15.3)
27
+ faraday (1.0.1)
27
28
  multipart-post (>= 1.2, < 3)
28
29
  hashdiff (0.3.7)
29
- hashie (3.5.7)
30
- i18n (1.1.1)
30
+ hashie (4.1.0)
31
+ i18n (1.8.2)
31
32
  concurrent-ruby (~> 1.0)
32
33
  json (2.1.0)
33
- json-jwt (1.9.4)
34
- activesupport
34
+ json-jwt (1.12.0)
35
+ activesupport (>= 4.2)
35
36
  aes_key_wrap
36
37
  bindata
37
- jwt (2.1.0)
38
- minitest (5.11.3)
39
- multi_json (1.13.1)
38
+ jwt (2.2.1)
39
+ minitest (5.14.1)
40
+ multi_json (1.14.1)
40
41
  multi_xml (0.6.0)
41
- multipart-post (2.0.0)
42
- oauth2 (1.4.1)
43
- faraday (>= 0.8, < 0.16.0)
42
+ multipart-post (2.1.1)
43
+ oauth2 (1.4.4)
44
+ faraday (>= 0.8, < 2.0)
44
45
  jwt (>= 1.0, < 3.0)
45
46
  multi_json (~> 1.3)
46
47
  multi_xml (~> 0.5)
47
48
  rack (>= 1.2, < 3)
48
- omniauth (1.8.1)
49
- hashie (>= 3.4.6, < 3.6.0)
49
+ omniauth (1.9.1)
50
+ hashie (>= 3.4.6)
50
51
  rack (>= 1.6.2, < 3)
51
- omniauth-oauth2 (1.5.0)
52
+ omniauth-oauth2 (1.6.0)
52
53
  oauth2 (~> 1.1)
53
- omniauth (~> 1.2)
54
+ omniauth (~> 1.9)
54
55
  public_suffix (3.0.3)
55
- rack (2.0.6)
56
- rake (10.5.0)
56
+ rack (2.2.2)
57
+ rake (13.0.1)
57
58
  rspec (3.8.0)
58
59
  rspec-core (~> 3.8.0)
59
60
  rspec-expectations (~> 3.8.0)
@@ -74,12 +75,13 @@ GEM
74
75
  simplecov-html (~> 0.10.0)
75
76
  simplecov-html (0.10.2)
76
77
  thread_safe (0.3.6)
77
- tzinfo (1.2.5)
78
+ tzinfo (1.2.7)
78
79
  thread_safe (~> 0.1)
79
80
  webmock (3.4.2)
80
81
  addressable (>= 2.3.6)
81
82
  crack (>= 0.3.2)
82
83
  hashdiff
84
+ zeitwerk (2.3.0)
83
85
 
84
86
  PLATFORMS
85
87
  ruby
@@ -87,10 +89,10 @@ PLATFORMS
87
89
  DEPENDENCIES
88
90
  bundler (~> 1.16)
89
91
  omniauth-keycloak!
90
- rake (~> 10.0)
92
+ rake (~> 13.0)
91
93
  rspec (~> 3.0)
92
94
  simplecov (~> 0.16.1)
93
95
  webmock (~> 3.4.2)
94
96
 
95
97
  BUNDLED WITH
96
- 1.16.5
98
+ 2.1.4
data/README.md CHANGED
@@ -29,6 +29,47 @@ Rails.application.config.middleware.use OmniAuth::Builder do
29
29
  end
30
30
  ```
31
31
 
32
+ ## Devise Usage
33
+ Adapted from [Devise OmniAuth Instructions](https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview)
34
+
35
+ ```ruby
36
+ # app/models/user.rb
37
+ class User < ApplicationRecord
38
+ #...
39
+ devise :omniauthable, omniauth_providers: %i[keycloakopenid]
40
+ #...
41
+ end
42
+
43
+ # config/initializers/devise.rb
44
+ config.omniauth :keycloak_openid, "Example-Client-Name", "example-secret-if-configured", client_options: { site: "https://example.keycloak-url.com", realm: "example-realm" }, :strategy_class => OmniAuth::Strategies::KeycloakOpenId
45
+
46
+ # Below controller assumes callback route configuration following
47
+ # in config/routes.rb
48
+ Devise.setup do |config|
49
+ # ...
50
+ devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
51
+ end
52
+
53
+ # app/controllers/users/omniauth_callbacks_controller.rb
54
+ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
55
+ def keycloakopenid
56
+ Rails.logger.debug(request.env["omniauth.auth"])
57
+ @user = User.from_omniauth(request.env["omniauth.auth"])
58
+ if @user.persisted?
59
+ sign_in_and_redirect @user, event: :authentication
60
+ else
61
+ session["devise.keycloakopenid_data"] = request.env["omniauth.auth"]
62
+ redirect_to new_user_registration_url
63
+ end
64
+ end
65
+
66
+ def failure
67
+ redirect_to root_path
68
+ end
69
+ end
70
+
71
+ ```
72
+
32
73
  ## Contributing
33
74
 
34
75
  Bug reports and pull requests are welcome on GitHub at https://github.com/ccrockett/omniauth-keycloak. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Keycloak
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ Gem::Specification.new do |spec|
5
5
  spec.authors = ["Cameron Crockett"]
6
6
  spec.email = ["cameron.crockett@ccrockett.com"]
7
7
 
8
- spec.description = %q{"Omniauth strategy for Keycloak"}
8
+ spec.description = %q{Omniauth strategy for Keycloak}
9
9
  spec.summary = spec.description
10
10
  spec.homepage = "https://github.com/ccrockett/omniauth-keycloak"
11
11
  spec.license = "MIT"
@@ -25,9 +25,10 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_dependency "omniauth", "~> 1.9.0"
27
27
  spec.add_dependency "omniauth-oauth2", "~> 1.6.0"
28
- spec.add_dependency "json-jwt", "~> 1.9.4"
28
+ spec.add_dependency "json-jwt", "~> 1.12"
29
+
29
30
  spec.add_development_dependency "bundler", "~> 1.16"
30
- spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rake", "~> 13.0"
31
32
  spec.add_development_dependency "rspec", "~> 3.0"
32
33
  spec.add_development_dependency 'simplecov', '~> 0.16.1'
33
34
  spec.add_development_dependency 'webmock', '~> 3.4.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-keycloak
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Crockett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-16 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.9.4
47
+ version: '1.12'
48
48
  type: :runtime
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: 1.9.4
54
+ version: '1.12'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '13.0'
76
76
  type: :development
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: '10.0'
82
+ version: '13.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 3.4.2
125
- description: '"Omniauth strategy for Keycloak"'
125
+ description: Omniauth strategy for Keycloak
126
126
  email:
127
127
  - cameron.crockett@ccrockett.com
128
128
  executables: []
@@ -166,9 +166,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  - !ruby/object:Gem::Version
167
167
  version: 1.3.5
168
168
  requirements: []
169
- rubyforge_project:
170
- rubygems_version: 2.7.4
169
+ rubygems_version: 3.0.3
171
170
  signing_key:
172
171
  specification_version: 4
173
- summary: '"Omniauth strategy for Keycloak"'
172
+ summary: Omniauth strategy for Keycloak
174
173
  test_files: []