public class OAuthServerFilter extends java.lang.Object implements ContainerRequestFilter
When an application is deployed as a Servlet or Filter this Jersey filter can be registered using the following initialization parameters:
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.oauth.server.api.OAuthServerFilter</param-value>
</init-param>
This filter requires an implementation of OAuthProvider interface to be
included in the list of providers of the application (e.g. by annotating it
using the Provider annotation and having it on the scanning classpath).
The constants in this class indicate how you can parameterize this filter. E.g. when an application is deployed as a Servlet or Filter you can set the path patern to be ignored by this filter using the following initialization parameter:
<init-param>
<param-name>com.sun.jersey.config.property.oauth.ignorePathPattern</param-name>
<param-value>/login</param-value>
</init-param>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FEATURE_NO_FAIL
If set to true makes the correct OAuth authentication optional - i.e.
|
static java.lang.String |
PROPERTY_GC_PERIOD
Property that can be set to frequency of collecting nonces exceeding max.
|
static java.lang.String |
PROPERTY_IGNORE_PATH_PATTERN
Property that can be set to a regular expression used to match the path (relative to the base URI) this
filter should not be applied to.
|
static java.lang.String |
PROPERTY_MAX_AGE
Can be set to max.
|
static java.lang.String |
PROPERTY_REALM
OAuth realm.
|
| Constructor and Description |
|---|
OAuthServerFilter(ResourceConfig rc,
OAuthProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
ContainerRequest |
filter(ContainerRequest request) |
public static final java.lang.String PROPERTY_REALM
public static final java.lang.String PROPERTY_IGNORE_PATH_PATTERN
public static final java.lang.String PROPERTY_MAX_AGE
public static final java.lang.String PROPERTY_GC_PERIOD
public static final java.lang.String FEATURE_NO_FAIL
Response.Status#BAD_REQUEST or Response.Status#UNAUTHORIZED) the filter
will ignore this request (as if it was not authenticated) and let the web application deal with it.public OAuthServerFilter(@Context ResourceConfig rc, @Context OAuthProvider provider)
public ContainerRequest filter(ContainerRequest request)
filter in interface ContainerRequestFilterCopyright © 2016 Oracle Corporation. All Rights Reserved.