Class OAuthTokenValidationConfig
java.lang.Object
org.apache.camel.spi.OAuthTokenValidationConfig
Configuration for validating incoming OAuth 2.0 bearer tokens.
Used by
OAuthTokenValidationFactory to validate JWT tokens locally via JWKS or opaque tokens via RFC 7662
introspection.- Since:
- 4.21
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a copy of the source configuration. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a copy of this configuration.Allowed JWS algorithms for JWT validation.intClock skew leeway in seconds for temporal claims.intNetwork connect timeout in seconds for outbound HTTP calls (JWKS fetch, OIDC discovery, introspection).@Nullable StringFirst configured expected audience claim, or null when no audience is configured.Accepted audience claim values.@Nullable StringExpected issuer claim.@Nullable StringExpected JWTtypheader, for exampleat+jwt.@Nullable StringClient identifier used for token introspection.@Nullable StringClient secret used for token introspection.@Nullable StringRFC 7662 introspection endpoint used to validate opaque tokens.longJWKS cache TTL in seconds.@Nullable StringJWKS endpoint used to validate JWT signatures.longOIDC discovery metadata cache TTL in seconds.@Nullable StringOIDC discovery URL used to resolve JWKS, introspection, and issuer metadata.intNetwork read timeout in seconds for outbound HTTP calls (JWKS fetch, OIDC discovery, introspection).booleanWhether JWKS, OIDC discovery, or introspection endpoints may use plain HTTP.booleanWhether token validation may proceed without configured accepted audiences.booleanWhether token validation may proceed without an expected issuer.booleanWhether to require theexpclaim in JWT tokens.setAllowedJwsAlgorithms(@Nullable Set<String> allowedJwsAlgorithms) Sets the allowed JWS algorithms for JWT validation.setAllowInsecureHttp(boolean allowInsecureHttp) Sets whether JWKS, OIDC discovery, or introspection endpoints may use plain HTTP.setAllowMissingAudience(boolean allowMissingAudience) Sets whether token validation may proceed without configured accepted audiences.setAllowMissingIssuer(boolean allowMissingIssuer) Sets whether token validation may proceed without an expected issuer.setClockSkewSeconds(int clockSkewSeconds) Sets clock skew leeway in seconds for temporal claims.setConnectTimeoutSeconds(int connectTimeoutSeconds) Sets the network connect timeout in seconds for outbound HTTP calls.setExpectedAudience(@Nullable String expectedAudience) Sets a single accepted audience claim.setExpectedAudiences(@Nullable Set<String> expectedAudiences) Sets the accepted audience claim values.setExpectedIssuer(@Nullable String expectedIssuer) Sets the expected issuer claim.setExpectedTokenType(@Nullable String expectedTokenType) Sets the expected JWTtypheader.setIntrospectionClientId(@Nullable String introspectionClientId) Sets the client identifier used for token introspection.setIntrospectionClientSecret(@Nullable String introspectionClientSecret) Sets the client secret used for token introspection.setIntrospectionEndpoint(@Nullable String introspectionEndpoint) Sets the RFC 7662 introspection endpoint used to validate opaque tokens.setJwksCacheTtlSeconds(long jwksCacheTtlSeconds) Sets the JWKS cache TTL in seconds.setJwksEndpoint(@Nullable String jwksEndpoint) Sets the JWKS endpoint used to validate JWT signatures.setOidcDiscoveryCacheTtlSeconds(long oidcDiscoveryCacheTtlSeconds) Sets the OIDC discovery metadata cache TTL in seconds.setOidcDiscoveryUrl(@Nullable String oidcDiscoveryUrl) Sets the OIDC discovery URL used to resolve JWKS, introspection, and issuer metadata.setReadTimeoutSeconds(int readTimeoutSeconds) Sets the network read timeout in seconds for outbound HTTP calls.setRequireExpiration(boolean requireExpiration) Sets whether JWT tokens must contain anexpclaim.
-
Constructor Details
-
OAuthTokenValidationConfig
public OAuthTokenValidationConfig() -
OAuthTokenValidationConfig
Creates a copy of the source configuration.- Since:
- 4.21
-
-
Method Details
-
copy
-
getJwksEndpoint
JWKS endpoint used to validate JWT signatures.- Since:
- 4.21
-
setJwksEndpoint
Sets the JWKS endpoint used to validate JWT signatures.- Since:
- 4.21
-
getIntrospectionEndpoint
RFC 7662 introspection endpoint used to validate opaque tokens.- Since:
- 4.21
-
setIntrospectionEndpoint
Sets the RFC 7662 introspection endpoint used to validate opaque tokens.- Since:
- 4.21
-
getIntrospectionClientId
Client identifier used for token introspection.- Since:
- 4.21
-
setIntrospectionClientId
Sets the client identifier used for token introspection.- Since:
- 4.21
-
getIntrospectionClientSecret
Client secret used for token introspection.- Since:
- 4.21
-
setIntrospectionClientSecret
public OAuthTokenValidationConfig setIntrospectionClientSecret(@Nullable String introspectionClientSecret) Sets the client secret used for token introspection.- Since:
- 4.21
-
getExpectedIssuer
-
setExpectedIssuer
Sets the expected issuer claim.- Since:
- 4.21
-
getExpectedAudience
First configured expected audience claim, or null when no audience is configured. PrefergetExpectedAudiences()for new code that accepts multiple audiences.- Since:
- 4.21
-
setExpectedAudience
Sets a single accepted audience claim.- Since:
- 4.21
-
getExpectedAudiences
-
setExpectedAudiences
Sets the accepted audience claim values.- Since:
- 4.21
-
getExpectedTokenType
Expected JWTtypheader, for exampleat+jwt. When set, JWT tokens without this type are rejected.- Since:
- 4.21
-
setExpectedTokenType
Sets the expected JWTtypheader.- Since:
- 4.21
-
getClockSkewSeconds
public int getClockSkewSeconds()Clock skew leeway in seconds for temporal claims.- Since:
- 4.21
-
setClockSkewSeconds
Sets clock skew leeway in seconds for temporal claims.- Since:
- 4.21
-
getJwksCacheTtlSeconds
public long getJwksCacheTtlSeconds()JWKS cache TTL in seconds.- Since:
- 4.21
-
setJwksCacheTtlSeconds
Sets the JWKS cache TTL in seconds.- Since:
- 4.21
-
getOidcDiscoveryUrl
OIDC discovery URL used to resolve JWKS, introspection, and issuer metadata.- Since:
- 4.21
-
setOidcDiscoveryUrl
Sets the OIDC discovery URL used to resolve JWKS, introspection, and issuer metadata.- Since:
- 4.21
-
getOidcDiscoveryCacheTtlSeconds
public long getOidcDiscoveryCacheTtlSeconds()OIDC discovery metadata cache TTL in seconds.- Since:
- 4.21
-
setOidcDiscoveryCacheTtlSeconds
public OAuthTokenValidationConfig setOidcDiscoveryCacheTtlSeconds(long oidcDiscoveryCacheTtlSeconds) Sets the OIDC discovery metadata cache TTL in seconds.- Since:
- 4.21
-
getConnectTimeoutSeconds
public int getConnectTimeoutSeconds()Network connect timeout in seconds for outbound HTTP calls (JWKS fetch, OIDC discovery, introspection).- Since:
- 4.21
-
setConnectTimeoutSeconds
Sets the network connect timeout in seconds for outbound HTTP calls.- Since:
- 4.21
-
getReadTimeoutSeconds
public int getReadTimeoutSeconds()Network read timeout in seconds for outbound HTTP calls (JWKS fetch, OIDC discovery, introspection).- Since:
- 4.21
-
setReadTimeoutSeconds
Sets the network read timeout in seconds for outbound HTTP calls.- Since:
- 4.21
-
isRequireExpiration
public boolean isRequireExpiration()Whether to require theexpclaim in JWT tokens. When true (default), JWTs without an expiration claim are rejected.- Since:
- 4.21
-
setRequireExpiration
Sets whether JWT tokens must contain anexpclaim.- Since:
- 4.21
-
getAllowedJwsAlgorithms
-
setAllowedJwsAlgorithms
public OAuthTokenValidationConfig setAllowedJwsAlgorithms(@Nullable Set<String> allowedJwsAlgorithms) Sets the allowed JWS algorithms for JWT validation. Blank values are ignored.- Since:
- 4.21
-
isAllowMissingAudience
public boolean isAllowMissingAudience()Whether token validation may proceed without configured accepted audiences.- Since:
- 4.21
-
setAllowMissingAudience
Sets whether token validation may proceed without configured accepted audiences.- Since:
- 4.21
-
isAllowMissingIssuer
public boolean isAllowMissingIssuer()Whether token validation may proceed without an expected issuer.- Since:
- 4.21
-
setAllowMissingIssuer
Sets whether token validation may proceed without an expected issuer.- Since:
- 4.21
-
isAllowInsecureHttp
public boolean isAllowInsecureHttp()Whether JWKS, OIDC discovery, or introspection endpoints may use plain HTTP.- Since:
- 4.21
-
setAllowInsecureHttp
Sets whether JWKS, OIDC discovery, or introspection endpoints may use plain HTTP.- Since:
- 4.21
-