be.looorent.micronaut.security.PublicKeyService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of keycloak-micronaut-adapter Show documentation
Show all versions of keycloak-micronaut-adapter Show documentation
Create API middleware to check Authorization headers against Keycloak
package be.looorent.micronaut.security;
import java.security.PublicKey;
import java.util.Optional;
/**
* How to find a public key to validate a JWT?
* @author Lorent Lempereur - [email protected]
*/
public interface PublicKeyService {
/**
* This method finds a public key identified by an identifier, generally stored in a JWT header.
* @param kid a key id
* @return the public key identified by kid ; or return empty() is the public key has not been found.
*/
Optional findPublicKey(String kid);
}