Class: KeycloakRack::KeyFetcher Private

Inherits:
Object
  • Object
show all
Defined in:
lib/keycloak_rack/key_fetcher.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Fetches the public key for a keycloak installation.

Instance Method Summary collapse

Instance Method Details

#find_public_keysDry::Monads::Success({ Symbol => Object }), Dry::Monads::Failure(Symbol, String)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Dry::Monads::Success({ Symbol => Object }))
  • (Dry::Monads::Failure(Symbol, String))


14
15
16
17
18
# File 'lib/keycloak_rack/key_fetcher.rb', line 14

def find_public_keys
  http_client.get_json(realm_id, "protocol/openid-connect/certs").or do |(code, reason, response)|
    Dry::Monads::Result::Failure[:invalid_public_keys, "Could not fetch public keys: #{reason.inspect}"]
  end
end