@Test public void validate_throwsWhenKeyIdIsNull() { assertThatThrownBy(() -> { cut.validate("eyJhbGciOiJSUzI1NiJ9", "RS256", "", DUMMY_JKU_URI.toString(), null); }).isInstanceOf(IllegalArgumentException.class).hasMessageContaining("tokenKeyId"); }
@Override public ValidationResult validate(Token token) { String jwksUri; String keyId; try { jwksUri = getOrRequestJwksUri(token); String fallbackPublicKey = null; if (configuration != null && configuration.hasProperty("verificationkey")) { fallbackPublicKey = configuration.getProperty("verificationkey"); } keyId = getOrDefaultKeyId(token); return validate(token.getTokenValue(), getOrDefaultSignatureAlgorithm(token), keyId, jwksUri, fallbackPublicKey); } catch (OAuth2ServiceException | IllegalArgumentException e) { return createInvalid("Error occurred during jwks uri determination: {}", e.getMessage()); } }
JwtSignatureValidator implements Validator<Token> { @Override public ValidationResult validate(Token token) { String jwksUri; String keyId; try { jwksUri = getOrRequestJwksUri(token); String fallbackPublicKey = null; if (configuration != null && configuration.hasProperty("verificationkey")) { fallbackPublicKey = configuration.getProperty("verificationkey"); } keyId = getOrDefaultKeyId(token); return validate(token.getTokenValue(), getOrDefaultSignatureAlgorithm(token), keyId, jwksUri, fallbackPublicKey); } catch (OAuth2ServiceException | IllegalArgumentException e) { return createInvalid("Error occurred during jwks uri determination: {}", e.getMessage()); } } }
JwtSignatureValidator implements Validator<Token> { @Override public ValidationResult validate(Token token) { String jwksUri; String keyId; try { jwksUri = getOrRequestJwksUri(token); String fallbackPublicKey = null; if (configuration != null && configuration.hasProperty("verificationkey")) { fallbackPublicKey = configuration.getProperty("verificationkey"); } keyId = getOrDefaultKeyId(token); return validate(token.getTokenValue(), getOrDefaultSignatureAlgorithm(token), keyId, jwksUri, fallbackPublicKey); } catch (OAuth2ServiceException | IllegalArgumentException e) { return createInvalid("Error occurred during jwks uri determination: {}", e.getMessage()); } } JwtSignatureValidator(OAuth2ServiceConfiguration configuration, OAuth2TokenKeyServiceWithCache tokenKeyService,
			OidcConfigurationServiceWithCache oidcConfigurationService); }
JwtSignatureValidator implements Validator<Token> { @Override public ValidationResult validate(Token token) { String jwksUri; String keyId; try { jwksUri = getOrRequestJwksUri(token); String fallbackPublicKey = null; if (configuration != null && configuration.hasProperty("verificationkey")) { fallbackPublicKey = configuration.getProperty("verificationkey"); } keyId = getOrDefaultKeyId(token); return validate(token.getTokenValue(), getOrDefaultSignatureAlgorithm(token), keyId, jwksUri, fallbackPublicKey); } catch (OAuth2ServiceException | IllegalArgumentException e) { return createInvalid("Error occurred during jwks uri determination: {}", e.getMessage()); } } JwtSignatureValidator(OAuth2ServiceConfiguration configuration, OAuth2TokenKeyServiceWithCache tokenKeyService,
			OidcConfigurationServiceWithCache oidcConfigurationService); @Override ValidationResult validate(Token token); }
JwtSignatureValidator implements Validator<Token> { @Override public ValidationResult validate(Token token) { String jwksUri; String keyId; try { jwksUri = getOrRequestJwksUri(token); String fallbackPublicKey = null; if (configuration != null && configuration.hasProperty("verificationkey")) { fallbackPublicKey = configuration.getProperty("verificationkey"); } keyId = getOrDefaultKeyId(token); return validate(token.getTokenValue(), getOrDefaultSignatureAlgorithm(token), keyId, jwksUri, fallbackPublicKey); } catch (OAuth2ServiceException | IllegalArgumentException e) { return createInvalid("Error occurred during jwks uri determination: {}", e.getMessage()); } } JwtSignatureValidator(OAuth2ServiceConfiguration configuration, OAuth2TokenKeyServiceWithCache tokenKeyService,
			OidcConfigurationServiceWithCache oidcConfigurationService); @Override ValidationResult validate(Token token);  }