Package org.wildfly.security.http
Class HttpAuthenticator.Builder
- java.lang.Object
- 
- org.wildfly.security.http.HttpAuthenticator.Builder
 
- 
- Enclosing class:
- HttpAuthenticator
 
 public static class HttpAuthenticator.Builder extends Object ABuilderto configure and create an instance ofHttpAuthenticator.
- 
- 
Field SummaryFields Modifier and Type Field Description private HttpExchangeSpihttpExchangeSpiprivate Supplier<IdentityCache>identityCacheSupplierprivate booleanignoreOptionalFailuresprivate Consumer<Runnable>logoutHandlerConsumerprivate Supplier<List<HttpServerAuthenticationMechanism>>mechanismSupplierprivate StringprogrammaticMechanismNameprivate booleanrequiredprivate SecurityDomainsecurityDomain
 - 
Constructor SummaryConstructors Constructor Description Builder()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpAuthenticatorbuild()Build the newHttpAuthenticatorinstance.HttpAuthenticator.BuilderregisterLogoutHandler(Consumer<Runnable> logoutHandlerConsumer)HttpAuthenticator.BuildersetHttpExchangeSpi(HttpExchangeSpi httpExchangeSpi)Set theHttpExchangeSpiinstance for the current request to allow integration with the Elytron APIs.HttpAuthenticator.BuildersetIdentityCacheSupplier(Supplier<IdentityCache> identityCacheSupplier)Set aSupplierwhich acts as a factory to return a newIdentityCacheinstance for the current request, this allows alternative caching strategies to be provided.HttpAuthenticator.BuildersetIgnoreOptionalFailures(boolean ignoreOptionalFailures)Where authentication is not required but is still attempted a failure of an authentication mechanism will cause the challenges to be sent and the current request returned to the client, setting this value to true will allow the failure to be ignored.HttpAuthenticator.BuildersetMechanismSupplier(Supplier<List<HttpServerAuthenticationMechanism>> mechanismSupplier)Set the supplier to use to obtain list ofHttpServerAuthenticationMechanismimplementations instances to use, based on the configured policy.HttpAuthenticator.BuildersetProgrammaticMechanismName(String programmaticMechanismName)Set the mechanism name that should be used for programmatic authentication if one is not provided at the time of the call.HttpAuthenticator.BuildersetRequired(boolean required)Sets if authentication is required for the current request, if not required mechanisms will be called to be given the opportunity to authenticateHttpAuthenticator.BuildersetSecurityDomain(SecurityDomain securityDomain)Set theSecurityDomainto use for programmatic authentication.
 
- 
- 
- 
Field Detail- 
mechanismSupplierprivate Supplier<List<HttpServerAuthenticationMechanism>> mechanismSupplier 
 - 
securityDomainprivate SecurityDomain securityDomain 
 - 
httpExchangeSpiprivate HttpExchangeSpi httpExchangeSpi 
 - 
requiredprivate boolean required 
 - 
ignoreOptionalFailuresprivate boolean ignoreOptionalFailures 
 - 
programmaticMechanismNameprivate String programmaticMechanismName 
 - 
identityCacheSupplierprivate Supplier<IdentityCache> identityCacheSupplier 
 
- 
 - 
Method Detail- 
setMechanismSupplierpublic HttpAuthenticator.Builder setMechanismSupplier(Supplier<List<HttpServerAuthenticationMechanism>> mechanismSupplier) Set the supplier to use to obtain list ofHttpServerAuthenticationMechanismimplementations instances to use, based on the configured policy.- Parameters:
- mechanismSupplier- the- Supplierwith the configured authentication policy
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
setSecurityDomainpublic HttpAuthenticator.Builder setSecurityDomain(SecurityDomain securityDomain) Set theSecurityDomainto use for programmatic authentication.- Parameters:
- securityDomain- the- SecurityDomainto use for programmatic authentication.
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
setHttpExchangeSpipublic HttpAuthenticator.Builder setHttpExchangeSpi(HttpExchangeSpi httpExchangeSpi) Set theHttpExchangeSpiinstance for the current request to allow integration with the Elytron APIs.- Parameters:
- httpExchangeSpi- the- HttpExchangeSpiinstance for the current request
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
setRequiredpublic HttpAuthenticator.Builder setRequired(boolean required) Sets if authentication is required for the current request, if not required mechanisms will be called to be given the opportunity to authenticate- Parameters:
- required- is authentication required for the current request?
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
setIgnoreOptionalFailurespublic HttpAuthenticator.Builder setIgnoreOptionalFailures(boolean ignoreOptionalFailures) Where authentication is not required but is still attempted a failure of an authentication mechanism will cause the challenges to be sent and the current request returned to the client, setting this value to true will allow the failure to be ignored. This setting has no effect when required is set totrue, in that case all failures will result in a client- Parameters:
- ignoreOptionalFailures- should mechanism failures be ignored if authentication is optional.
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
registerLogoutHandlerpublic HttpAuthenticator.Builder registerLogoutHandler(Consumer<Runnable> logoutHandlerConsumer) A Consumerresponsible for registering aRunnableemitted by one of the mechanisms during the evaluation of a request and representing some action to be taken during logout.This method is mainly targeted for programmatic logout where logout requests are send by the application after the authentication. Although, integration code is free to register the logout handler whatever they want in order to support different logout scenarios. - Parameters:
- logoutHandlerConsumer- the consumer responsible for registering the logout handler (not- null)
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
setProgrammaticMechanismNamepublic HttpAuthenticator.Builder setProgrammaticMechanismName(String programmaticMechanismName) Set the mechanism name that should be used for programmatic authentication if one is not provided at the time of the call.- Parameters:
- programmaticMechanismName- the name of the mechanism to use for programmatic authentication.
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
setIdentityCacheSupplierpublic HttpAuthenticator.Builder setIdentityCacheSupplier(Supplier<IdentityCache> identityCacheSupplier) Set aSupplierwhich acts as a factory to return a newIdentityCacheinstance for the current request, this allows alternative caching strategies to be provided.- Parameters:
- identityCacheSupplier- - a factory which returns new- IdentityCacheinstances for the current request.
- Returns:
- the HttpAuthenticator.Builderto allow method call chaining.
 
 - 
buildpublic HttpAuthenticator build() Build the newHttpAuthenticatorinstance.- Returns:
- the new HttpAuthenticatorinstance.
 
 
- 
 
-