@Override public PublicKeyLocator getPublicKeyLocator() { return delegate.getPublicKeyLocator(); }
public void updateNotBefore(int notBefore) { this.notBefore = notBefore; getPublicKeyLocator().reset(this); }
private static PublicKey getPublicKey(String kid, KeycloakDeployment deployment) throws VerificationException { PublicKeyLocator pkLocator = deployment.getPublicKeyLocator(); PublicKey publicKey = pkLocator.getPublicKey(kid, deployment); if (publicKey == null) { log.errorf("Didn't find publicKey for kid: %s", kid); throw new VerificationException("Didn't find publicKey for specified kid"); } return publicKey; }
public boolean isConfigured() { return getRealm() != null && getPublicKeyLocator() != null && (isBearerOnly() || getAuthServerBaseUrl() != null); }
/** * For single-tenant deployments, it complements KeycloakDeployment * by resolving a relative Auth Server's URL based on the current request * * For multi-tenant deployments, defers the resolution of KeycloakDeployment * to the KeycloakConfigResolver . * * @param facade the Request/Response Façade , used to either determine * the Auth Server URL (single tenant) or pass thru to the * KeycloakConfigResolver. * @return */ public KeycloakDeployment resolveDeployment(HttpFacade facade) { if (null != configResolver) { return configResolver.resolve(facade.getRequest()); } if (deployment == null) return null; if (deployment.getAuthServerBaseUrl() == null) return deployment; KeycloakDeployment resolvedDeployment = resolveUrls(deployment, facade); if (resolvedDeployment.getPublicKeyLocator() == null) { throw new RuntimeException("KeycloakDeployment was never initialized through appropriate SPIs"); } return resolvedDeployment; }