test_openid_connect 0.1.8 → 0.1.12

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: '09b5005499845ddd3461e3a447e7be737a8a77a7839899230746aca5fb08960a'
4
- data.tar.gz: 4d5e84a10da97a4a73ee30a541cd1b39df1a2af3966dc3a55e278d869b9cb00b
3
+ metadata.gz: '08b8aab9d6f8be10dca4c562cd9b1bcf44ef0682679a418a2fb162e8a427c5bd'
4
+ data.tar.gz: 544cca78e0001d07ef7a8a49cab2b753469ee9ed36824392df7c35feedc2021a
5
5
  SHA512:
6
- metadata.gz: 9244a231387717133b04a4c99e37931550641296a27b05545a6d1b9e015f0341fea23818748fb0bd3eaf322d3cc04c520778ce8bf70d17a9280e005bd6d22ac0
7
- data.tar.gz: 103e2063c105aa1480be90af4d8ae11308bdc163f92572c211e3231dde74bf1695c99f67797c22d81e6fbeecb6cc47e16c8a5c784b2c5ef147ad96ff0caf531a
6
+ metadata.gz: 36e2dc1c9c5f1479c19dace8ab23126704b6c3291dbe62212ce93ff2fa47a7cae2c876abd942fe0aaf720b592fb3cfc02ca5ab3be763fcebc54c2099184f29ab
7
+ data.tar.gz: 99c728da0123e906be2f9e754afd0387c45eae6d306e75fbddde5103b219a63b730deb9223e64bc214fc78d2896eb8f1b0df5a2b856554a2f1dac6f00ff78f7b
@@ -3,12 +3,12 @@
3
3
  require 'omniauth-oauth2'
4
4
 
5
5
  module ::OmniAuth
6
- module OpenIDConnect
6
+ module Oauth2
7
7
  class DiscoveryError < Error; end
8
8
  end
9
9
 
10
10
  module Strategies
11
- class OpenIDConnect < OmniAuth::Strategies::OAuth2
11
+ class Oauth2 < OmniAuth::Strategies::OAuth2
12
12
  puts "*/*/*/*/*/*/*/*/*/*/*/*/*/*/"
13
13
  option :scope, "openid"
14
14
  option :discovery, true
@@ -46,7 +46,7 @@ module ::OmniAuth
46
46
 
47
47
  discovery_params.each do |internal_key, external_key|
48
48
  val = discovery_document[external_key].to_s
49
- raise ::OmniAuth::OpenIDConnect::DiscoveryError.new("missing discovery parameter #{external_key}") if val.nil? || val.empty?
49
+ raise ::OmniAuth::Oauth2::DiscoveryError.new("missing discovery parameter #{external_key}") if val.nil? || val.empty?
50
50
  options[:client_options][internal_key] = val
51
51
  end
52
52
 
@@ -56,14 +56,18 @@ module ::OmniAuth
56
56
 
57
57
  def request_phase
58
58
  begin
59
- discover! if options[:discovery]
60
- rescue ::OmniAuth::OpenIDConnect::DiscoveryError => e
59
+ discover!
60
+ rescue ::OmniAuth::Oauth2::DiscoveryError => e
61
61
  fail!(:openid_connect_discovery_error, e)
62
62
  end
63
63
 
64
64
  super
65
65
  end
66
66
 
67
+ # def request_phase
68
+ # redirect client.auth_code.authorize_url({:redirect_uri => callback_url}.merge(options.authorize_params))
69
+ # end
70
+
67
71
  def authorize_params
68
72
  super.tap do |params|
69
73
  options[:passthrough_authorize_options].each do |k|
@@ -88,28 +92,28 @@ module ::OmniAuth
88
92
  super.merge(params)
89
93
  end
90
94
 
91
- def callback_phase
92
- if request.params["error"] && request.params["error_description"]
93
- # verbose_log("Error handled, redirecting\n\n#{response.to_yaml}")
94
- return redirect(response)
95
- end
96
-
97
- begin
98
- discover! if options[:discovery]
99
-
100
- oauth2_callback_phase = super
101
- return oauth2_callback_phase if env['omniauth.error']
102
-
103
- if id_token_info["nonce"].nil? || id_token_info["nonce"].empty? || id_token_info["nonce"] != session.delete("omniauth.nonce")
104
- return fail!(:csrf_detected, CallbackError.new(:csrf_detected, "CSRF detected"))
105
- end
106
- oauth2_callback_phase
107
- rescue ::OmniAuth::OpenIDConnect::DiscoveryError => e
108
- fail!(:openid_connect_discovery_error, e)
109
- rescue JWT::DecodeError => e
110
- fail!(:jwt_decode_failed, e)
111
- end
112
- end
95
+ # def callback_phase
96
+ # if request.params["error"] && request.params["error_description"]
97
+ # # verbose_log("Error handled, redirecting\n\n#{response.to_yaml}")
98
+ # return redirect(response)
99
+ # end
100
+
101
+ # begin
102
+ # discover! if options[:discovery]
103
+
104
+ # oauth2_callback_phase = super
105
+ # return oauth2_callback_phase if env['omniauth.error']
106
+
107
+ # if id_token_info["nonce"].nil? || id_token_info["nonce"].empty? || id_token_info["nonce"] != session.delete("omniauth.nonce")
108
+ # return fail!(:csrf_detected, CallbackError.new(:csrf_detected, "CSRF detected"))
109
+ # end
110
+ # oauth2_callback_phase
111
+ # rescue ::OmniAuth::OpenIDConnect::DiscoveryError => e
112
+ # fail!(:openid_connect_discovery_error, e)
113
+ # rescue JWT::DecodeError => e
114
+ # fail!(:jwt_decode_failed, e)
115
+ # end
116
+ # end
113
117
 
114
118
  def id_token_info
115
119
  # Verify the claims in the JWT
@@ -200,10 +204,10 @@ module ::OmniAuth
200
204
  end
201
205
  end
202
206
 
203
- OmniAuth.config.add_camelization 'oauth2', 'OpenIDConnect'
207
+ # OmniAuth.config.add_camelization 'oauth2', 'OpenIDConnect'
204
208
 
205
- module ::OmniAuth
206
- module Strategies
207
- autoload :OpenIDConnect, "lib/omniauth/test_openid_connect.rb"
208
- end
209
- end
209
+ # module ::OmniAuth
210
+ # module Strategies
211
+ # autoload :OpenIDConnect, "lib/omniauth/test_openid_connect.rb"
212
+ # end
213
+ # end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "test_openid_connect"
5
- spec.version = "0.1.8"
5
+ spec.version = "0.1.12"
6
6
  spec.required_ruby_version = ">= 2.4.0"
7
7
  spec.authors = ["Burak Akça"]
8
8
  spec.email = ["burak.akca834@gmail.com"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_openid_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burak Akça
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-31 00:00:00.000000000 Z
11
+ date: 2021-09-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'desc desc desc desc '
14
14
  email: