Interface OAuth2AuthenticatorConfig
@Immutable(lazyhash=true)
public interface OAuth2AuthenticatorConfig
Configuration options for
OAuth2Authenticator.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static OAuth2AuthenticatorConfigfromConfigSupplier(Function<String, String> config) Creates a newOAuth2AuthenticatorConfigfrom the given configuration supplier.The OAuth2 authorization endpoint.default DurationHow long to wait for an authorization code.The port to use for the local web server that listens for the authorization code.default DurationThe maximum time a background thread can be idle before it is closed.The OAuth2 client ID.The OAuth2 client secret.default DurationThe default access token lifespan.default DurationThe default refresh token lifespan.The OAuth2 device authorization endpoint.default DurationHow often to poll the token endpoint.default DurationHow long to wait for the device code flow to complete.default ScheduledExecutorServiceThe executor to use for background tasks such as refreshing tokens.default GrantTypeThe OAuth2 grant type.The root URL of the OpenID Connect identity issuer provider, which will be used for discovering supported endpoints and their locations.default com.fasterxml.jackson.databind.ObjectMapperTheObjectMapperto use for JSON serialization and deserialization.The OAuth2 password.default DurationFor how long the OAuth2 client should keep the tokens fresh, if the client is not being actively used.default DurationThe refresh safety window.getScope()The OAuth2 scope.The SSL context to use for HTTPS connections to the authentication provider, if the server uses a self-signed certificate or a certificate signed by a CA that is not in the default trust store of the JVM.The OAuth2 token endpoint.default booleanWhether token exchange is enabled.The OAuth2 username.
-
Method Details
-
fromConfigSupplier
Creates a newOAuth2AuthenticatorConfigfrom the given configuration supplier.- Parameters:
config- the configuration supplier- Returns:
- a new
OAuth2AuthenticatorConfig - Throws:
NullPointerException- ifconfigisnull, or a required configuration option is missingIllegalArgumentException- if the configuration is otherwise invalid- See Also:
-
getIssuerUrl
The root URL of the OpenID Connect identity issuer provider, which will be used for discovering supported endpoints and their locations.Endpoint discovery is performed using the OpenID Connect Discovery metadata published by the issuer. See OpenID Connect Discovery 1.0 for more information.
-
getTokenEndpoint
The OAuth2 token endpoint. Either this orgetIssuerUrl()must be set. -
getAuthEndpoint
The OAuth2 authorization endpoint. Either this orgetIssuerUrl()must be set, if the grant type isGrantType.AUTHORIZATION_CODE. -
getDeviceAuthEndpoint
The OAuth2 device authorization endpoint. Either this orgetIssuerUrl()must be set, if the grant type isGrantType.DEVICE_CODE. -
getGrantType
The OAuth2 grant type. Defaults toGrantType.CLIENT_CREDENTIALS. -
getClientId
String getClientId()The OAuth2 client ID. Must be set. -
getClientSecret
Secret getClientSecret()The OAuth2 client secret. Must be set.Once read by the Nessie client, the secret contents will be cleared from memory.
-
getUsername
The OAuth2 username. Only relevant forGrantType.PASSWORDgrant type. -
getPassword
The OAuth2 password. Only relevant forGrantType.PASSWORDgrant type.Once read by the Nessie client, the password contents will be cleared from memory.
-
getScope
The OAuth2 scope. Optional. -
getTokenExchangeEnabled
@Default default boolean getTokenExchangeEnabled()Whether token exchange is enabled. Defaults totrue. -
getDefaultAccessTokenLifespan
The default access token lifespan. Optional, defaults toNessieConfigConstants.DEFAULT_DEFAULT_ACCESS_TOKEN_LIFESPAN. -
getDefaultRefreshTokenLifespan
The default refresh token lifespan. Optional, defaults toNessieConfigConstants.DEFAULT_DEFAULT_REFRESH_TOKEN_LIFESPAN. -
getRefreshSafetyWindow
The refresh safety window. A new token will be fetched when the current token's remaining lifespan is less than this value. Optional, defaults toNessieConfigConstants.DEFAULT_REFRESH_SAFETY_WINDOW. -
getPreemptiveTokenRefreshIdleTimeout
For how long the OAuth2 client should keep the tokens fresh, if the client is not being actively used. Defaults toNessieConfigConstants.DEFAULT_PREEMPTIVE_TOKEN_REFRESH_IDLE_TIMEOUT. -
getBackgroundThreadIdleTimeout
The maximum time a background thread can be idle before it is closed. Only relevant when using the defaultexecutor. Defaults toNessieConfigConstants.DEFAULT_BACKGROUND_THREAD_IDLE_TIMEOUT. -
getAuthorizationCodeFlowTimeout
How long to wait for an authorization code. Defaults toNessieConfigConstants.DEFAULT_AUTHORIZATION_CODE_FLOW_TIMEOUT. Only relevant when using theGrantType.AUTHORIZATION_CODEgrant type. -
getAuthorizationCodeFlowWebServerPort
OptionalInt getAuthorizationCodeFlowWebServerPort()The port to use for the local web server that listens for the authorization code. Optional. If not set or set to zero, a random port from the dynamic client port range will be used. Only relevant when using theGrantType.AUTHORIZATION_CODEgrant type. -
getDeviceCodeFlowTimeout
How long to wait for the device code flow to complete. Defaults toNessieConfigConstants.DEFAULT_DEVICE_CODE_FLOW_TIMEOUT. Only relevant when using theGrantType.DEVICE_CODEgrant type. -
getDeviceCodeFlowPollInterval
How often to poll the token endpoint. Defaults toNessieConfigConstants.DEFAULT_DEVICE_CODE_FLOW_POLL_INTERVAL. Only relevant when using theGrantType.DEVICE_CODEgrant type. -
getSslContext
Optional<SSLContext> getSslContext()The SSL context to use for HTTPS connections to the authentication provider, if the server uses a self-signed certificate or a certificate signed by a CA that is not in the default trust store of the JVM. Optional; if not set, the default SSL context is used. -
getObjectMapper
@Default default com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()TheObjectMapperto use for JSON serialization and deserialization. Defaults to a vanilla instance. -
getExecutor
The executor to use for background tasks such as refreshing tokens. Defaults to a thread pool with daemon threads, and a single thread initially. The pool will grow as needed and can also shrink to zero threads if no activity is detected forgetBackgroundThreadIdleTimeout(). -
builder
-