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 static client secret.The OAuth2 client secret supplier.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.The executor to use for background tasks such as refreshing tokens.Additional parameters to be included in the request.default GrantTypeThe OAuth2 grant type.default ImpersonationConfigThe impersonation configuration.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 static password.The OAuth2 password supplier.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()Deprecated.The OAuth2 scopes.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 TokenExchangeConfigThe token exchange configuration.default booleanDeprecated.The OAuth2 username.parseExtraParams(String text)
-
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:
-
parseExtraParams
-
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.
- See Also:
-
getTokenEndpoint
The OAuth2 token endpoint. Either this orgetIssuerUrl()must be set.- See Also:
-
getAuthEndpoint
The OAuth2 authorization endpoint. Either this orgetIssuerUrl()must be set, if the grant type isGrantType.AUTHORIZATION_CODE.- See Also:
-
getDeviceAuthEndpoint
The OAuth2 device authorization endpoint. Either this orgetIssuerUrl()must be set, if the grant type isGrantType.DEVICE_CODE.- See Also:
-
getGrantType
The OAuth2 grant type. Defaults toGrantType.CLIENT_CREDENTIALS.- See Also:
-
getClientId
String getClientId()The OAuth2 client ID. Must be set.- See Also:
-
getClientSecret
The OAuth2 static client secret. Either this attribute orgetClientSecretSupplier()must be set, if a client secret is required by the IdP.- See Also:
-
getClientSecretSupplier
The OAuth2 client secret supplier. Either this attribute orgetClientSecret()must be set, if a client secret is required by the IdP. -
getUsername
The OAuth2 username. Only relevant forGrantType.PASSWORDgrant type.- See Also:
-
getPassword
The OAuth2 static password. Only relevant forGrantType.PASSWORDgrant type. Either this attribute orgetPasswordSupplier()must be set if a password is required.- See Also:
-
getPasswordSupplier
The OAuth2 password supplier. Only relevant forGrantType.PASSWORDgrant type. Either this attribute orgetPassword()must be set if a password is required. -
getScope
Deprecated. -
getScopes
The OAuth2 scopes. Optional.- See Also:
-
getExtraRequestParameters
Additional parameters to be included in the request. This is useful for custom parameters that are not covered by the standard OAuth2.0 specification. -
getTokenExchangeEnabled
Deprecated. -
getTokenExchangeConfig
The token exchange configuration. Optional. -
getImpersonationConfig
The impersonation configuration. Optional. -
getDefaultAccessTokenLifespan
The default access token lifespan. Optional, defaults toNessieConfigConstants.DEFAULT_DEFAULT_ACCESS_TOKEN_LIFESPAN.- See Also:
-
getDefaultRefreshTokenLifespan
The default refresh token lifespan. Optional, defaults toNessieConfigConstants.DEFAULT_DEFAULT_REFRESH_TOKEN_LIFESPAN.- See Also:
-
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.- See Also:
-
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.- See Also:
-
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.- See Also:
-
getAuthorizationCodeFlowTimeout
How long to wait for an authorization code. Defaults toNessieConfigConstants.DEFAULT_AUTHORIZATION_CODE_FLOW_TIMEOUT. Only relevant when using theGrantType.AUTHORIZATION_CODEgrant type.- See Also:
-
getAuthorizationCodeFlowWebServerPort
OptionalInt getAuthorizationCodeFlowWebServerPort()The port to use for the local web server that listens for the authorization code.When running a client inside a container make sure to specify a port and forward the port to the container host.
If not set or set to zero, a random port from the dynamic client port range will be used. Only relevant when using the
GrantType.AUTHORIZATION_CODEgrant type.- See Also:
-
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.- See Also:
-
getDeviceCodeFlowPollInterval
How often to poll the token endpoint. Defaults toNessieConfigConstants.DEFAULT_DEVICE_CODE_FLOW_POLL_INTERVAL. Only relevant when using theGrantType.DEVICE_CODEgrant type.- See Also:
-
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
Optional<ScheduledExecutorService> 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
-