oidc_provider 0.3.1 → 0.3.6

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: 3beab25ffd432f614292a9c6bc8b9641869a6629942929d13c8e1c9b76b26161
4
- data.tar.gz: a7282decd0f4fc012173a258f2de2435bb7662e47e3aabea78779528252cbd09
3
+ metadata.gz: 281787754d33ec3161d0e112b969a52d798852006c5907874e5afb0c8551c798
4
+ data.tar.gz: 273261208a3a0cb9672396c1b73983561217072d3e65d0e07389c4f8aee0e08d
5
5
  SHA512:
6
- metadata.gz: dd5d60c85a63a9935b483577a112929813b5af3b05b95e1d3502d7d1806cccda8e5ee44796cf06f4cb50a783719f6cbbf9cb453575746c709339bc575ae68521
7
- data.tar.gz: 9ad31d7f3ce28a50385474952ff7e86b788be62d2aef4f0104af3c201398f2f1f5b9673970fc1026bb80cda24ffcd7bb887b63b2c2a55d4c75965c0c0f9a8774
6
+ metadata.gz: 155aec9d5a0a9249a5443647afee08b722920c3ec6ecee83e5c2bcf0e678ff02a807c20a437eb951765f03903e36bd49b3e6ffc1b24d8e404bcfbd9dc9fa5465
7
+ data.tar.gz: 462bf6e47e53215404bdd8245e14daf6d9697f8f617945aa7ead145ff4cceb812bdf311df6b82d193d66f85fe1c19751e35cb57f2c3eee6928d35b183486424d
data/README.md CHANGED
@@ -92,5 +92,5 @@ The gem is available as open source under the terms of the [MIT License](https:/
92
92
 
93
93
  ```
94
94
  gem build oidc_provider.gemspec
95
- gem push oidc_provider-0.1.0.gem
95
+ gem push oidc_provider-0.3.2.gem
96
96
  ```
@@ -1,5 +1,6 @@
1
1
  module OIDCProvider
2
2
  class ApplicationController < ActionController::Base
3
3
  include Concerns::Authentication
4
+ include Concerns::Session
4
5
  end
5
6
  end
@@ -13,7 +13,7 @@ module OIDCProvider
13
13
  client_id: @client.identifier,
14
14
  nonce: oauth_request.nonce,
15
15
  scopes: requested_scopes,
16
- account: current_account
16
+ account: oidc_current_account
17
17
  )
18
18
 
19
19
  oauth_response.code = authorization.code
@@ -1,7 +1,7 @@
1
1
  module OIDCProvider
2
2
  module Concerns
3
3
  module Authentication
4
- def current_account
4
+ def oidc_current_account
5
5
  send(OIDCProvider.current_account_method)
6
6
  end
7
7
 
@@ -10,7 +10,7 @@ module OIDCProvider
10
10
  end
11
11
 
12
12
  def require_authentication
13
- authenticate_user!
13
+ send(OIDCProvider.current_authentication_method)
14
14
  end
15
15
 
16
16
  def require_access_token
@@ -18,6 +18,10 @@ module OIDCProvider
18
18
  raise Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new
19
19
  end
20
20
  end
21
+
22
+ def unauthenticate!
23
+ send(OIDCProvider.current_unauthenticate_method)
24
+ end
21
25
  end
22
26
  end
23
27
  end
@@ -0,0 +1,9 @@
1
+ module OIDCProvider
2
+ module Concerns
3
+ module Sessions
4
+ def after_oidc_sign_out_path
5
+ "/"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -27,11 +27,11 @@ module OIDCProvider
27
27
  def openid_configuration
28
28
  config = OpenIDConnect::Discovery::Provider::Config::Response.new(
29
29
  issuer: OIDCProvider.issuer,
30
- authorization_endpoint: authorizations_url,
31
- token_endpoint: tokens_url,
32
- userinfo_endpoint: user_info_url,
33
- end_session_endpoint: end_session_url,
34
- jwks_uri: jwks_url,
30
+ authorization_endpoint: authorizations_url(host: OIDCProvider.issuer),
31
+ token_endpoint: tokens_url(host: OIDCProvider.issuer),
32
+ userinfo_endpoint: user_info_url(host: OIDCProvider.issuer),
33
+ end_session_endpoint: end_session_url(host: OIDCProvider.issuer),
34
+ jwks_uri: jwks_url(host: OIDCProvider.issuer),
35
35
  scopes_supported: ["openid"] + OIDCProvider.supported_scopes.map(&:name),
36
36
  response_types_supported: [:code],
37
37
  grant_types_supported: [:authorization_code],
@@ -1,10 +1,10 @@
1
1
  module OIDCProvider
2
2
  class SessionsController < ApplicationController
3
- before_filter :require_authentication
3
+ before_action :require_authentication
4
4
 
5
5
  def destroy
6
6
  unauthenticate!
7
- redirect_to root_url
7
+ redirect_to after_oidc_sign_out_path
8
8
  end
9
9
  end
10
10
  end
@@ -31,6 +31,12 @@ module OIDCProvider
31
31
  mattr_accessor :current_account_method
32
32
  @@current_account_method = :current_user
33
33
 
34
+ mattr_accessor :current_authentication_method
35
+ @@current_authentication_method = :authenticate_user!
36
+
37
+ mattr_accessor :current_unauthenticate_method
38
+ @@current_unauthenticate_method = :sign_out
39
+
34
40
  mattr_accessor :account_identifier
35
41
  @@account_identifier = :id
36
42
 
@@ -1,3 +1,3 @@
1
1
  module OIDCProvider
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oidc_provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Carey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-08 00:00:00.000000000 Z
11
+ date: 2020-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -52,6 +52,7 @@ files:
52
52
  - app/controllers/oidc_provider/authorizations_controller.rb
53
53
  - app/controllers/oidc_provider/concerns/authentication.rb
54
54
  - app/controllers/oidc_provider/concerns/connect_endpoint.rb
55
+ - app/controllers/oidc_provider/concerns/session.rb
55
56
  - app/controllers/oidc_provider/discovery_controller.rb
56
57
  - app/controllers/oidc_provider/sessions_controller.rb
57
58
  - app/controllers/oidc_provider/user_infos_controller.rb
@@ -94,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.7.6.2
98
+ rubygems_version: 3.0.3
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Uses the openid_connect gem to turn a Rails app into an OpenID Connect provider.