Package be.looorent.keycloak
Class KeycloakPublicKeyService
- java.lang.Object
-
- be.looorent.keycloak.KeycloakPublicKeyService
-
- All Implemented Interfaces:
PublicKeyService
@Singleton @Context public class KeycloakPublicKeyService extends java.lang.Object implements PublicKeyService
Service that retrieves a set of JWK from Keycloak (using HTTP), that can eager or lazy load them at initialization time. Requires three properties: * keycloak.base-url * keycloak.realm-id * keycloak.eager-load-public-keys
-
-
Method Summary
Modifier and Type Method Description java.util.Optional<java.security.PublicKey>findPublicKey(java.lang.String kid)This method finds a public key identified by an identifier, generally stored in a JWT header.voidinitialize()
-
-
-
Method Detail
-
findPublicKey
public java.util.Optional<java.security.PublicKey> findPublicKey(java.lang.String kid)
Description copied from interface:PublicKeyServiceThis method finds a public key identified by an identifier, generally stored in a JWT header.- Specified by:
findPublicKeyin interfacePublicKeyService- Parameters:
kid- a key id- Returns:
- the public key identified by kid ; or return empty() is the public key has not been found.
-
initialize
@PostConstruct public void initialize()
-
-