public static class HttpAuthenticator.Builder extends Object
Builder
to configure and create an instance of HttpAuthenticator
.Modifier and Type | Method and Description |
---|---|
HttpAuthenticator |
build()
Build the new
HttpAuthenticator instance. |
HttpAuthenticator.Builder |
registerLogoutHandler(Consumer<Runnable> logoutHandlerConsumer)
|
HttpAuthenticator.Builder |
setHttpExchangeSpi(HttpExchangeSpi httpExchangeSpi)
Set the
HttpExchangeSpi instance for the current request to allow integration with the Elytron APIs. |
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.
|
HttpAuthenticator.Builder |
setMechanismSupplier(Supplier<List<HttpServerAuthenticationMechanism>> mechanismSupplier)
Set the
Supplier to use to obtain the actual HttpServerAuthenticationMechanism instances based
on the configured policy. |
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
|
public HttpAuthenticator.Builder setMechanismSupplier(Supplier<List<HttpServerAuthenticationMechanism>> mechanismSupplier)
Supplier>
to use to obtain the actual HttpServerAuthenticationMechanism
instances based
on the configured policy.mechanismSupplier
- the Supplier>
with the configured authentication policy.HttpAuthenticator.Builder
to allow method call chaining.public HttpAuthenticator.Builder setHttpExchangeSpi(HttpExchangeSpi httpExchangeSpi)
HttpExchangeSpi
instance for the current request to allow integration with the Elytron APIs.httpExchangeSpi
- the HttpExchangeSpi
instance for the current requestHttpAuthenticator.Builder
to allow method call chaining.public HttpAuthenticator.Builder setRequired(boolean required)
required
- is authentication required for the current request?HttpAuthenticator.Builder
to allow method call chaining.public HttpAuthenticator.Builder setIgnoreOptionalFailures(boolean ignoreOptionalFailures)
true
, in that case all failures will result in a clientignoreOptionalFailures
- should mechanism failures be ignored if authentication is optional.HttpAuthenticator.Builder
to allow method call chaining.public HttpAuthenticator.Builder registerLogoutHandler(Consumer<Runnable> logoutHandlerConsumer)
A Consumer
responsible for registering a Runnable
emitted 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.
logoutHandlerConsumer
- the consumer responsible for registering the logout handler (not null
)HttpAuthenticator.Builder
to allow method call chaining.public HttpAuthenticator build()
HttpAuthenticator
instance.HttpAuthenticator
instance.Copyright © 2017 JBoss by Red Hat. All rights reserved.