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
ADynamicFeaturethat registers the provided auth filter to resource methods annotated with theRolesAllowed,PermitAllandDenyAllannotations.In conjunction with
RolesAllowedDynamicFeatureit enables authorization AND authentication of requests on the annotated methods.If authorization is not a concern, then
RolesAllowedDynamicFeaturecould be omitted. But to enable authentication, thePermitAllannotation 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 aClassto 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 voidconfigure(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)
-
-