oidc_provider 0.3.0 → 0.3.5

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: 052162d08f6ce2895b4deed51b80a11f0a4a9bc01e82d61b95c5f93ad6080284
4
- data.tar.gz: fb94f8fa4d0feb3a134d457ab941faf3c5bdf935359b5dbe593c423c6137524c
3
+ metadata.gz: f903581d92df029d8a6f15819adc80c23e0392e9460692589fcc2ecb7bcc6f08
4
+ data.tar.gz: fd0121228874ac0265be84e98d825edf6d5bc0aa5a950758389724692f33c8cf
5
5
  SHA512:
6
- metadata.gz: f2aae6b2d8794a0d7ae42073a4b83a7db6910a5f9379fe79789347930d47af6fe5275eef2745efe0f34e1f2bfa437304d7df8109a31dae29fbcb061f23f9b294
7
- data.tar.gz: d6ea6683c1a05f2fd8d8413ed7a58cb877a04aa9ea4ed55307bd69b6cd63743d790e753530bdce95606b170b19a6cfd353384c3826a1613613bf572dfbd93345
6
+ metadata.gz: 510c91695ff3ae6fce87ca2f8c3ac718182982d78d28c7da6ded06b95596ea5a4d03ea5abc69cb77185adb08e92ed54be0c06ea972519683403b2f8d2a248243
7
+ data.tar.gz: 657fdfc65b6206738bf228c9f12370ccfd2aa49892676821d8d58a3bce62beaf9777b857c3a042cd3efa45a9618e29473f0e00331c270ba930753a87ec6592e8
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
  ```
@@ -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
@@ -27,10 +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
- 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),
34
35
  scopes_supported: ["openid"] + OIDCProvider.supported_scopes.map(&:name),
35
36
  response_types_supported: [:code],
36
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 OIDCProvider.after_sign_out_path
8
8
  end
9
9
  end
10
10
  end
@@ -31,9 +31,18 @@ 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
 
43
+ mattr_accessor :after_sign_out_path
44
+ @@after_sign_out_path = "/"
45
+
37
46
  def self.add_client(&block)
38
47
  @@clients << Client::Builder.new(&block).build
39
48
  end
@@ -1,3 +1,3 @@
1
1
  module OIDCProvider
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.5'
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.0
4
+ version: 0.3.5
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-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails