Package io.dropwizard.auth
Class AuthDynamicFeature
- java.lang.Object
-
- io.dropwizard.auth.AuthDynamicFeature
-
- All Implemented Interfaces:
javax.ws.rs.container.DynamicFeature
public class AuthDynamicFeature extends Object implements javax.ws.rs.container.DynamicFeature
ADynamicFeature
that registers the provided auth filter to resource methods annotated with theRolesAllowed
,PermitAll
andDenyAll
annotations.In conjunction with
RolesAllowedDynamicFeature
it enables authorization AND authentication of requests on the annotated methods.If authorization is not a concern, then
RolesAllowedDynamicFeature
could be omitted. But to enable authentication, thePermitAll
annotation should be placed on the corresponding resource methods.Note that registration of the filter will follow the semantics of
Configurable.register(Class)
andConfigurable.register(Object)
: passing the filter as aClass
to theAuthDynamicFeature(Class)
constructor will result in dependency injection, while objects passed to theAuthDynamicFeature(ContainerRequestFilter)
will be used directly.
-
-
Constructor Summary
Constructors Constructor Description AuthDynamicFeature(Class<? extends javax.ws.rs.container.ContainerRequestFilter> authFilterClass)
AuthDynamicFeature(javax.ws.rs.container.ContainerRequestFilter authFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(javax.ws.rs.container.ResourceInfo resourceInfo, javax.ws.rs.core.FeatureContext context)
-
-
-
Constructor Detail
-
AuthDynamicFeature
public AuthDynamicFeature(javax.ws.rs.container.ContainerRequestFilter authFilter)
-
AuthDynamicFeature
public AuthDynamicFeature(Class<? extends javax.ws.rs.container.ContainerRequestFilter> authFilterClass)
-
-