From cec090cb5f4194ec1c3ccb31704331c5d6f74a5f Mon Sep 17 00:00:00 2001 From: Katie Edgar <38359249+web-kat@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:54:31 -0400 Subject: [PATCH] Fix config urls post issuer update (#43) Changing the default `issuer` value broke the `.well-known` and token introspection endpoints. This PR corrects those values --- lib/omniauth/strategies/base_strategy.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/omniauth/strategies/base_strategy.rb b/lib/omniauth/strategies/base_strategy.rb index bd2e4b6..642b3f7 100644 --- a/lib/omniauth/strategies/base_strategy.rb +++ b/lib/omniauth/strategies/base_strategy.rb @@ -32,7 +32,7 @@ def self.decode_logout_token(token) end def self.fetch_jwks - key = ::OpenIDConnect.http_client.get("#{default_options[:issuer]}.well-known/jwks.json").body + key = ::OpenIDConnect.http_client.get("#{default_options[:issuer]}/.well-known/jwks.json").body json = key.is_a?(String) ? JSON.parse(key) : key return JSON::JWK::Set.new(json["keys"]) if json.key?("keys") @@ -45,7 +45,7 @@ def self.introspect_token(token, api_key) body: { token: token }, } - response = ::OpenIDConnect.http_client.post("#{default_options[:issuer]}api/tokens/introspect", **options) + response = ::OpenIDConnect.http_client.post("#{default_options[:issuer]}/api/tokens/introspect", **options) raise APIError, "#{default_options[:name]} error: #{response.status}" if response.status.to_i >= 400