Skip to content

Commit

Permalink
Fix config urls post issuer update (#43)
Browse files Browse the repository at this point in the history
Changing the default `issuer` value broke the `.well-known` and token
introspection endpoints. This PR corrects those values
  • Loading branch information
web-kat authored Jul 1, 2024
1 parent 5e37fa4 commit cec090c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/omniauth/strategies/base_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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

Expand Down

0 comments on commit cec090c

Please sign in to comment.