public class AuthenticationFeature extends Object implements javax.ws.rs.core.Feature
Feature which can be registered in server application to enable authentication support using
Authenticate annotation.
JAX-RS resource classes and/or methods annotated with Authenticate will be protected from unauthorized
access, performing client authentication using the AuthContext security context Realm.
Using this feature, the SecurityContext of the JAX-RS requests bound to Authenticate annotated
resources will be replaced with an AuthContext compatible implementation and will be used to perform
authentication when required.
Allowed authentication schemes can be specified using Authenticate.schemes() annotation attribute. If any
scheme is specified, a scheme-matching AuthenticationToken.AuthenticationTokenResolver must be registered in Realm to
perform authentication with given scheme.
The Realm to use is obtained either from a registered ContextResolver of Realm type, if
available, or as a Context resource using Realm.getCurrent().
When authentication informations provided by a client according to allowed authentication schemes (if any) for an
Authenticate resource are missing or invalid, a 401 - Unauthorized status response is returned,
including a HttpHeaders.WWW_AUTHENTICATE header for each allowed authentication scheme, if any.
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_CONTEXT_PROPERTY_NAME
Current request
AuthContext reference property name |
static String |
DISABLE_AUTHENTICATION
JAX-RS configuration property name to put in the application configuration to disable the
AuthenticationFeature registration. |
| Constructor and Description |
|---|
AuthenticationFeature() |
public static final String DISABLE_AUTHENTICATION
AuthenticationFeature registration.public static final String AUTH_CONTEXT_PROPERTY_NAME
AuthContext reference property nameCopyright © 2019 The Holon Platform. All rights reserved.