Package io.dropwizard.auth
Class AuthFilter<C,P extends Principal>
- java.lang.Object
-
- io.dropwizard.auth.AuthFilter<C,P>
-
- All Implemented Interfaces:
javax.ws.rs.container.ContainerRequestFilter
- Direct Known Subclasses:
BasicCredentialAuthFilter
,ChainedAuthFilter
,OAuthCredentialAuthFilter
@Priority(1000) public abstract class AuthFilter<C,P extends Principal> extends Object implements javax.ws.rs.container.ContainerRequestFilter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthFilter.AuthFilterBuilder<C,P extends Principal,T extends AuthFilter<C,P>>
Abstract builder for auth filters.
-
Field Summary
Fields Modifier and Type Field Description protected Authenticator<C,P>
authenticator
protected Authorizer<P>
authorizer
protected org.slf4j.Logger
logger
protected String
prefix
protected String
realm
protected UnauthorizedHandler
unauthorizedHandler
-
Constructor Summary
Constructors Constructor Description AuthFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
authenticate(javax.ws.rs.container.ContainerRequestContext requestContext, @Nullable C credentials, String scheme)
Authenticates a request with user credentials and setup the security context.
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
prefix
protected String prefix
-
realm
protected String realm
-
authenticator
protected Authenticator<C,P extends Principal> authenticator
-
authorizer
protected Authorizer<P extends Principal> authorizer
-
unauthorizedHandler
protected UnauthorizedHandler unauthorizedHandler
-
-
Method Detail
-
authenticate
protected boolean authenticate(javax.ws.rs.container.ContainerRequestContext requestContext, @Nullable C credentials, String scheme)
Authenticates a request with user credentials and setup the security context.- Parameters:
requestContext
- the context of the requestcredentials
- the user credentialsscheme
- the authentication scheme; one ofBASIC_AUTH, FORM_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH
. SeeSecurityContext
- Returns:
true
, if the request is authenticated, otherwisefalse
-
-