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.AuthenticationFilterBuilder
auditApi(AuditApi auditApi)
Sets the, mandatory,AuditApi
instance that the framework will use to audit the authentication result of processed requests.AuthenticationFilter.AuthenticationFilterBuilder
authModules(List<AuthenticationFilter.AuthenticationModuleBuilder> authModuleBuilders)
Sets the authentication modules that will be used to validate requests and secure response messages.AuthenticationFilter.AuthenticationFilterBuilder
authModules(AuthenticationFilter.AuthenticationModuleBuilder... authModuleBuilders)
Sets the authentication modules that will be used to validate requests and secure response messages.AuthenticationFilter
build()
Creates a newJaspiRuntimeFilter
instance based on the configuration provided.AuthenticationFilter.AuthenticationFilterBuilder
logger(org.slf4j.Logger logger)
Sets the logger instance that the framework will use to log debug messages.AuthenticationFilter.AuthenticationFilterBuilder
named(String name)
Sets the name of the logger instance that the framework should create and use to log debug messages.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.AuthenticationFilter.AuthenticationFilterBuilder
serviceSubject(Subject serviceSubject)
Sets the serviceSubject
that contains credentials, for this framework instance, that auth modules can use to secure response messages.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.
-
-
-
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 theLogger
instance.- 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
- TheLogger
instance.- Returns:
- This builder instance.
-
auditApi
public AuthenticationFilter.AuthenticationFilterBuilder auditApi(AuditApi auditApi)
Sets the, mandatory,AuditApi
instance that the framework will use to audit the authentication result of processed requests.- Parameters:
auditApi
- TheAuditApi
instance.- Returns:
- This builder instance.
-
serviceSubject
public AuthenticationFilter.AuthenticationFilterBuilder serviceSubject(Subject serviceSubject)
Sets the serviceSubject
that contains credentials, for this framework instance, that auth modules can use to secure response messages.- Parameters:
serviceSubject
- The serviceSubject
instance.- 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
- TheResourceExceptionHandler
instance.- 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
- AAuthenticationModuleBuilder
instance.- 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
- AAuthenticationModuleBuilder
instance.- 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
- AAuthenticationModuleBuilder
instance.- Returns:
- This builder instance.
- See Also:
authModules(AuthenticationModuleBuilder...)
-
build
public AuthenticationFilter build() throws AuthenticationException
Creates a newJaspiRuntimeFilter
instance based on the configuration provided.- Returns:
- A new Authentication Framework filter instance.
- Throws:
AuthenticationException
- If any auth modules cannot be initialized.IllegalStateException
- If theAuditApi
instance has not been set.
-
-