public final class Filters extends Object
Modifier and Type | Method and Description |
---|---|
static Filter |
chainOf(Filter... filters)
Creates a
Filter which encapsulates the provided filters
into a single Filter . |
static Filter |
chainOf(List<Filter> filters)
Creates a
Filter which encapsulates the provided filters
into a single Filter . |
static CsrfFilter.Builder |
newCsrfFilter(String cookieName)
Creates a filter that protects against cross-site request forgery (CSRF) attacks when using cookies for
authentication.
|
static Filter |
newDefaultCsrfFilter(String cookieName)
Creates a filter that protects against cross-site request forgery (CSRF) attacks when using cookies for
authentication.
|
static Filter |
newHttpBasicAuthenticationFilter(String username,
String password)
Creates an authentication
Filter that put a Basic Authorization
header in the request. |
static Filter |
newHttpBasicAuthenticationFilter(String username,
String password,
Charset charset)
Creates an authentication
Filter that put a Basic Authorization
header in the request. |
static Filter |
newOptionsFilter(String... allowedMethods)
Creates a
Filter which handles HTTP OPTIONS method requests. |
static Filter |
newSessionFilter(SessionManager sessionManager)
Creates a session
Filter that will use the provided
SessionManager to manage the users session. |
static Filter |
requestCopyFilter()
|
public static Filter newOptionsFilter(String... allowedMethods)
Filter
which handles HTTP OPTIONS method requests.allowedMethods
- The allowed HTTP methods of the endpoint.Filter
.public static Filter newSessionFilter(SessionManager sessionManager)
Filter
that will use the provided
SessionManager
to manage the users session.sessionManager
- The SessionManager
.Filter
.public static Filter requestCopyFilter()
Filter
which creates a defensive copy of the Request
-
on which the chain of execution will be based on. At the end of the chain of
execution, the request copy will be closed.RequestCopyFilter
.public static Filter newHttpBasicAuthenticationFilter(String username, String password)
Filter
that put a Basic Authorization
header in the request. It encodes the credentials using StandardCharsets.UTF_8
.public static Filter newHttpBasicAuthenticationFilter(String username, String password, Charset charset)
Filter
that put a Basic Authorization
header in the request.public static CsrfFilter.Builder newCsrfFilter(String cookieName)
cookieName
- the name of the cookie used for authentication.public static Filter newDefaultCsrfFilter(String cookieName)
cookieName
- the name of the cookie used for authentication.public static Filter chainOf(Filter... filters)
Filter
which encapsulates the provided filters
into a single Filter
.filters
- The list of filters to be invoked, in order.Filter
.Filters.chainOf(List)
public static Filter chainOf(List<Filter> filters)
Filter
which encapsulates the provided filters
into a single Filter
.filters
- The list of filters to be invoked, in order.Filter
.Filters.chainOf(Filter...)
Copyright © 2010-2018, ForgeRock All Rights Reserved.