Class BaseBuilder<B extends BaseBuilder<B,T>, T>
java.lang.Object
io.helidon.security.providers.oidc.common.BaseBuilder<B,T>
- Type Parameters:
B- type of the builderT- type of the object built by this builder
- Direct Known Subclasses:
OidcConfig.Builder, TenantConfig.Builder
-
Method Summary
Modifier and TypeMethodDescriptionAudience of issued tokens.URI of an authorization endpoint used to redirect users to for logging-in.baseScopes(String scopes) Configure base scopes.checkAudience(boolean checkAudience) Configure audience claim check.Client ID as generated by OIDC server.clientSecret(String clientSecret) Client secret as generated by OIDC server.clientTimeout(Duration duration) Timeout of calls using web client.Update this builder with values from configuration.decryptionKeys(Resource resource) A resource pointing to JWK with private keys used for JWE content key decryption.decryptionKeys(JwkKeys contentKeyDecryptionKeys) SetJwkKeysused for JWE content key decryption.identityUri(URI uri) URI of the identity server, base used to retrieve OIDC metadata.introspectEndpointUri(URI uri) Endpoint to use to validate JWT.Issuer of issued tokens.jwkCircuitBreaker(CircuitBreaker jwkCircuitBreaker) Circuit breaker around each complete retry batch used to load OIDC metadata and signing JWKs; by default, the circuit opens after one exhausted batch and permits a recovery probe after 5 seconds.jwkCircuitBreaker(CircuitBreakerConfig jwkCircuitBreaker) Circuit breaker used while loading OIDC metadata and signing JWK.Circuit breaker used while loading OIDC metadata and signing JWK.jwkCircuitBreaker(Supplier<? extends CircuitBreaker> supplier) Circuit breaker used while loading OIDC metadata and signing JWK.Retry used while loading OIDC metadata and signing JWKs; by default, it wraps two timeout-guarded attempts within an 11-second overall timeout.jwkRetry(RetryConfig jwkRetry) Retry used while loading OIDC metadata and signing JWK.jwkRetry(Consumer<RetryConfig.Builder> consumer) Retry used while loading OIDC metadata and signing JWK.Retry used while loading OIDC metadata and signing JWK.jwkTimeout(Timeout jwkTimeout) Timeout applied to each attempt to load OIDC metadata and signing JWKs; it defaults to 5 seconds, must be positive, must execute on the current thread, and must not exceed the retry overall timeout.jwkTimeout(TimeoutConfig jwkTimeout) Timeout applied to each attempt to load OIDC metadata and signing JWK.jwkTimeout(Consumer<TimeoutConfig.Builder> consumer) Timeout applied to each attempt to load OIDC metadata and signing JWK.jwkTimeout(Supplier<? extends Timeout> supplier) Timeout applied to each attempt to load OIDC metadata and signing JWK.logoutEndpointUri(URI logoutEndpointUri) URI of a logout endpoint used to redirect users to for logging-out.oidcMetadata(Resource resource) Resource configuration for OIDC Metadata containing endpoints to various identity services, as well as information about the identity server.oidcMetadata(ResourceConfig resourceConfig) Resource configuration for OIDC metadata.oidcMetadataJsonObject(JsonObject metadata) Helidon JSON with the OIDC metadata.oidcMetadataWellKnown(boolean useWellKnown) If set to true, metadata will be loaded from default (well known) location, unless it is explicitly defined using oidc-metadata-resource.optionalAudience(boolean optional) Allow audience claim to be optional.Realm to return when not redirecting and an error occurs that sends back WWW-Authenticate header.scopeAudience(String audience) Audience of the scope required by this application.serverType(String type) Configure one of the supported types of identity servers.A resource pointing to JWK with public keys of signing certificates used to validate JWT.signJwk(ResourceConfig resourceConfig) Resource configuration pointing to JWK with public keys of signing certificates used to validate JWT.SetJwkKeysto use for JWT validation.tokenEndpointAuthentication(OidcConfig.ClientAuthentication tokenEndpointAuthentication) Type of authentication to use when invoking the token endpoint.tokenEndpointUri(URI uri) URI of a token endpoint used to obtain a JWT based on the authentication code.validateJwtWithJwk(Boolean useJwk) Use JWK (a set of keys to validate signatures of JWT) to validate tokens.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
config
-
clientId
-
clientSecret
-
identityUri
-
realm
-
audience
-
issuer
-
validateJwtWithJwk
Use JWK (a set of keys to validate signatures of JWT) to validate tokens. Use this method when you want to use default values for JWK or introspection endpoint URI.- Parameters:
useJwk- when set to true, jwk is used, when set to false, introspect endpoint is used- Returns:
- updated builder instance
-
introspectEndpointUri
Endpoint to use to validate JWT. Either use this or setsignJwk(JwkKeys)orsignJwk(Resource).- Parameters:
uri- URI of introspection endpoint- Returns:
- updated builder instance
-
signJwk
-
signJwk
Resource configuration pointing to JWK with public keys of signing certificates used to validate JWT. Classpath and inline resources are loaded immediately. File system paths and URIs are loaded lazily and may recover if they become available later.- Parameters:
resourceConfig- resource configuration pointing to the JWK- Returns:
- updated builder instance
-
signJwk
-
jwkRetry
-
jwkRetry
Retry used while loading OIDC metadata and signing JWK. Each tenant creates its own retry lazily. An unnamed prototype uses the name "oidc-jwk-retry", sharing metrics with other retries using that name.- Parameters:
jwkRetry- prototype of retry to use- Returns:
- updated builder instance
-
jwkRetry
Retry used while loading OIDC metadata and signing JWK.- Parameters:
consumer- consumer of builder of retry to use- Returns:
- updated builder instance
-
jwkRetry
-
jwkTimeout
Timeout applied to each attempt to load OIDC metadata and signing JWKs; it defaults to 5 seconds, must be positive, must execute on the current thread, and must not exceed the retry overall timeout. Current-thread execution ensures that a retry cannot overlap an attempt that is still unwinding after an interrupt. The deadline interrupts the loader; prompt termination also depends on the underlying I/O honoring interruption or enforcing its own timeout.- Parameters:
jwkTimeout- timeout to use- Returns:
- updated builder instance
-
jwkTimeout
Timeout applied to each attempt to load OIDC metadata and signing JWK. Each tenant creates its own timeout lazily. An unnamed prototype uses the name "oidc-jwk-timeout", sharing metrics with other timeouts using that name.- Parameters:
jwkTimeout- prototype of timeout to use- Returns:
- updated builder instance
-
jwkTimeout
Timeout applied to each attempt to load OIDC metadata and signing JWK.- Parameters:
consumer- consumer of builder of timeout to use- Returns:
- updated builder instance
-
jwkTimeout
-
jwkCircuitBreaker
Circuit breaker around each complete retry batch used to load OIDC metadata and signing JWKs; by default, the circuit opens after one exhausted batch and permits a recovery probe after 5 seconds.- Parameters:
jwkCircuitBreaker- circuit breaker to use- Returns:
- updated builder instance
-
jwkCircuitBreaker
Circuit breaker used while loading OIDC metadata and signing JWK. Each tenant creates its own circuit breaker lazily. An unnamed prototype uses the name "oidc-jwk-circuit-breaker", sharing metrics with other circuit breakers using that name.- Parameters:
jwkCircuitBreaker- prototype of circuit breaker to use- Returns:
- updated builder instance
-
jwkCircuitBreaker
Circuit breaker used while loading OIDC metadata and signing JWK.- Parameters:
consumer- consumer of builder of circuit breaker to use- Returns:
- updated builder instance
-
jwkCircuitBreaker
Circuit breaker used while loading OIDC metadata and signing JWK.- Parameters:
supplier- supplier of circuit breaker to use- Returns:
- updated builder instance
-
tokenEndpointAuthentication
Type of authentication to use when invoking the token endpoint. WithOidcConfig.ClientAuthentication.CLIENT_SECRET_BASIC, credentials are sent only to POST requests on the resolved token endpoint scheme, host, and path and, when JWT introspection is used, to POST requests on the resolved introspection endpoint scheme, host, and path. Current supported options:- Parameters:
tokenEndpointAuthentication- authentication type- Returns:
- updated builder
-
authorizationEndpointUri
URI of an authorization endpoint used to redirect users to for logging-in. If not defined, it is obtained fromoidcMetadata(Resource), if that is not defined an attempt is made to useidentityUri(URI)/oauth2/v1/authorize.- Parameters:
uri- URI to use for token endpoint- Returns:
- updated builder instance
-
logoutEndpointUri
URI of a logout endpoint used to redirect users to for logging-out. If not defined, it is obtained fromoidcMetadata(Resource), if that is not defined an attempt is made to useidentityUri(URI)/oauth2/v1/userlogout.- Parameters:
logoutEndpointUri- URI to use to log out- Returns:
- updated builder instance
-
tokenEndpointUri
URI of a token endpoint used to obtain a JWT based on the authentication code. If not defined, it is obtained fromoidcMetadata(Resource), if that is not defined an attempt is made to useidentityUri(URI)/oauth2/v1/token.- Parameters:
uri- URI to use for token endpoint- Returns:
- updated builder instance
-
oidcMetadata
-
oidcMetadata
Resource configuration for OIDC metadata. Classpath and inline resources are loaded immediately. File system paths and URIs are loaded lazily and may recover if they become available later.- Parameters:
resourceConfig- resource configuration pointing to the JSON structure- Returns:
- updated builder instance
-
oidcMetadataJsonObject
Helidon JSON with the OIDC metadata.- Parameters:
metadata- metadata JSON- Returns:
- updated builder instance
- See Also:
-
baseScopes
-
oidcMetadataWellKnown
If set to true, metadata will be loaded from default (well known) location, unless it is explicitly defined using oidc-metadata-resource. If set to false, it would not be loaded even if oidc-metadata-resource is not defined. In such a case all URIs must be explicitly defined (e.g. token-endpoint-uri).- Parameters:
useWellKnown- whether to use well known location for OIDC metadata- Returns:
- updated builder instance
-
serverType
Configure one of the supported types of identity servers. If the type does not have an explicit mapping, a warning is logged and the default implementation is used.- Parameters:
type- Type of identity server. Currently supported isidcsor not configured (for default).- Returns:
- updated builder instance
-
clientTimeout
-
scopeAudience
Audience of the scope required by this application. This is prefixed to the scope name when requesting scopes from the identity server. Defaults to empty string.- Parameters:
audience- audience, if provided, end with "/" to append the scope correctly- Returns:
- updated builder instance
-
optionalAudience
Allow audience claim to be optional.- Parameters:
optional- whether the audience claim is optional (true) or not (false)- Returns:
- updated builder instance
-
checkAudience
Configure audience claim check.- Parameters:
checkAudience- whether the audience claim will be checked (true) or not (false)- Returns:
- updated builder instance
-
decryptionKeys
-
decryptionKeys
-