Class AuthenticationFilter.AuthenticationFilterBuilder
java.lang.Object
org.forgerock.caf.authentication.framework.AuthenticationFilter.AuthenticationFilterBuilder
- Enclosing class:
- AuthenticationFilter
Builder class that configures an Authentication Framework instance.
Usage:
builder.logger(logger)
.auditApi(auditApi)
.serviceSubject(serviceSubject)
.responseHandler(responseHandler)
.sessionModule(
configureModule(sessionAuthModule)
.requestPolicy(sessionAuthModuleRequestPolicy)
.responsePolicy(sessionAuthModuleResponsePolicy)
.callbackHandler(sessionAuthModuleHandler)
.withSettings(sessionAuthModuleSettings))
.authModules(
configureModule(authModuleOne)
.requestPolicy(authModuleOneRequestPolicy)
.responsePolicy(authModuleOneResponsePolicy)
.callbackHandler(authModuleOneHandler)
.withSettings(authModuleOneSettings),
configureModule(authModuleTwo)
.requestPolicy(authModuleTwoRequestPolicy)
.responsePolicy(authModuleTwoResponsePolicy)
.callbackHandler(authModuleTwoHandler)
.withSettings(authModuleTwoSettings))
.build();
- Since:
- 2.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the, mandatory,AuditApiinstance that the framework will use to audit the authentication result of processed requests.authModules(List<AuthenticationFilter.AuthenticationModuleBuilder> authModuleBuilders) Sets the authentication modules that will be used to validate requests and secure response messages.authModules(AuthenticationFilter.AuthenticationModuleBuilder... authModuleBuilders) Sets the authentication modules that will be used to validate requests and secure response messages.build()Creates a newJaspiRuntimeFilterinstance based on the configuration provided.logger(org.slf4j.Logger logger) Sets the logger instance that the framework will use to log debug messages.Sets the name of the logger instance that the framework should create and use to log debug messages.responseHandler(ResponseWriter responseWriter) Adds an additional response handler instance that adds support for protecting resources which return responses with non-JSON content types.serviceSubject(Subject serviceSubject) Sets the serviceSubjectthat contains credentials, for this framework instance, that auth modules can use to secure response messages.sessionModule(AuthenticationFilter.AuthenticationModuleBuilder sessionAuthModuleBuilder) Sets the session authentication module that will be used to validate request sessions and maintain sessions on response messages.
-
Constructor Details
-
AuthenticationFilterBuilder
public AuthenticationFilterBuilder()
-
-
Method Details
-
named
Sets the name of the logger instance that the framework should create and use to log debug messages.
If not set, the name defaults to: AuthenticationFilter.
- Parameters:
name- The name of theLoggerinstance.- Returns:
- This builder instance.
-
logger
Sets the logger instance that the framework will use to log debug messages.
If not set, the name defaults to: AuthenticationFilter.
- Parameters:
logger- TheLoggerinstance.- Returns:
- This builder instance.
-
auditApi
Sets the, mandatory,AuditApiinstance that the framework will use to audit the authentication result of processed requests.- Parameters:
auditApi- TheAuditApiinstance.- Returns:
- This builder instance.
-
serviceSubject
Sets the serviceSubjectthat contains credentials, for this framework instance, that auth modules can use to secure response messages.- Parameters:
serviceSubject- The serviceSubjectinstance.- Returns:
- This builder instance.
-
responseHandler
public AuthenticationFilter.AuthenticationFilterBuilder responseHandler(ResponseWriter responseWriter) Adds an additional response handler instance that adds support for protecting resources which return responses with non-JSON content types.- Parameters:
responseWriter- TheResourceExceptionHandlerinstance.- Returns:
- This builder instance.
-
sessionModule
public AuthenticationFilter.AuthenticationFilterBuilder sessionModule(AuthenticationFilter.AuthenticationModuleBuilder sessionAuthModuleBuilder) Sets the session authentication module that will be used to validate request sessions and maintain sessions on response messages.- Parameters:
sessionAuthModuleBuilder- AAuthenticationModuleBuilderinstance.- Returns:
- This builder instance.
-
authModules
public AuthenticationFilter.AuthenticationFilterBuilder authModules(AuthenticationFilter.AuthenticationModuleBuilder... authModuleBuilders) Sets the authentication modules that will be used to validate requests and secure response messages.- Parameters:
authModuleBuilders- AAuthenticationModuleBuilderinstance.- Returns:
- This builder instance.
- See Also:
-
authModules
public AuthenticationFilter.AuthenticationFilterBuilder authModules(List<AuthenticationFilter.AuthenticationModuleBuilder> authModuleBuilders) Sets the authentication modules that will be used to validate requests and secure response messages.- Parameters:
authModuleBuilders- AAuthenticationModuleBuilderinstance.- Returns:
- This builder instance.
- See Also:
-
build
Creates a newJaspiRuntimeFilterinstance based on the configuration provided.- Returns:
- A new Authentication Framework filter instance.
- Throws:
AuthenticationException- If any auth modules cannot be initialized.IllegalStateException- If theAuditApiinstance has not been set.
-