Class AuthenticationFilter.AuthenticationFilterBuilder
- java.lang.Object
-
- org.forgerock.caf.authentication.framework.AuthenticationFilter.AuthenticationFilterBuilder
-
- Enclosing class:
- AuthenticationFilter
public static class AuthenticationFilter.AuthenticationFilterBuilder extends Object
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 Constructor Description AuthenticationFilterBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationFilter.AuthenticationFilterBuilderauditApi(AuditApi auditApi)Sets the, mandatory,AuditApiinstance that the framework will use to audit the authentication result of processed requests.AuthenticationFilter.AuthenticationFilterBuilderauthModules(List<AuthenticationFilter.AuthenticationModuleBuilder> authModuleBuilders)Sets the authentication modules that will be used to validate requests and secure response messages.AuthenticationFilter.AuthenticationFilterBuilderauthModules(AuthenticationFilter.AuthenticationModuleBuilder... authModuleBuilders)Sets the authentication modules that will be used to validate requests and secure response messages.AuthenticationFilterbuild()Creates a newJaspiRuntimeFilterinstance based on the configuration provided.AuthenticationFilter.AuthenticationFilterBuilderlogger(org.slf4j.Logger logger)Sets the logger instance that the framework will use to log debug messages.AuthenticationFilter.AuthenticationFilterBuildernamed(String name)Sets the name of the logger instance that the framework should create and use to log debug messages.AuthenticationFilter.AuthenticationFilterBuilderresponseHandler(ResponseWriter responseWriter)Adds an additional response handler instance that adds support for protecting resources which return responses with non-JSON content types.AuthenticationFilter.AuthenticationFilterBuilderserviceSubject(Subject serviceSubject)Sets the serviceSubjectthat contains credentials, for this framework instance, that auth modules can use to secure response messages.AuthenticationFilter.AuthenticationFilterBuildersessionModule(AuthenticationFilter.AuthenticationModuleBuilder sessionAuthModuleBuilder)Sets the session authentication module that will be used to validate request sessions and maintain sessions on response messages.
-
-
-
Method Detail
-
named
public AuthenticationFilter.AuthenticationFilterBuilder named(String name)
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
public AuthenticationFilter.AuthenticationFilterBuilder logger(org.slf4j.Logger 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
public AuthenticationFilter.AuthenticationFilterBuilder auditApi(AuditApi 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
public AuthenticationFilter.AuthenticationFilterBuilder serviceSubject(Subject 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(java.util.List)
-
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:
authModules(AuthenticationModuleBuilder...)
-
build
public AuthenticationFilter build() throws AuthenticationException
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.
-
-