public abstract class AbstractBasicAuthenticationFilter extends Object implements javax.servlet.Filter
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractBasicAuthenticationFilter.Credentials |
Constructor and Description |
---|
AbstractBasicAuthenticationFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
protected void |
ensureSeraphForwardsRequest(javax.servlet.ServletRequest request)
Ensures that Seraph simply forwards the request without processing it.
|
protected String |
getAuthenticatedEntity(javax.servlet.http.HttpServletRequest request)
Returns the authenticated entity from the
request , or null if there is no authenticated entity. |
protected abstract String |
getAuthenticationErrorMessage()
Returns the authentication error message.
|
protected AbstractBasicAuthenticationFilter.Credentials |
getBasicAuthCredentials(javax.servlet.http.HttpServletRequest request)
Returns the Basic Auth credentials.
|
protected abstract String |
getBasicRealm()
Returns the Basic Realm in the WWW-Authenticate header.
|
protected abstract String |
getEntityAttributeKey()
Returns the HTTP request attribute key for the entity.
|
void |
init(javax.servlet.FilterConfig filterConfig) |
protected boolean |
isAuthenticated(javax.servlet.http.HttpServletRequest request,
AbstractBasicAuthenticationFilter.Credentials credentials)
Consider the request as authenticated, if the entity name in it matches the entity
name saved in the
HttpSession . |
protected void |
respondWithChallenge(javax.servlet.http.HttpServletResponse response)
Responds to request with a Basic Authentication challenge.
|
protected void |
setAuthenticatedEntity(javax.servlet.http.HttpServletRequest request,
String name)
Sets the authenticated entity.
|
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
protected AbstractBasicAuthenticationFilter.Credentials getBasicAuthCredentials(javax.servlet.http.HttpServletRequest request)
request
- the requestprotected boolean isAuthenticated(javax.servlet.http.HttpServletRequest request, AbstractBasicAuthenticationFilter.Credentials credentials)
HttpSession
.request
- HTTP servlet request possibly containing a HttpSessioncredentials
- credentials sent with the requestprotected void respondWithChallenge(javax.servlet.http.HttpServletResponse response) throws IOException
response
- the HTTP responseIOException
public void destroy()
destroy
in interface javax.servlet.Filter
protected void ensureSeraphForwardsRequest(javax.servlet.ServletRequest request)
request
- HttpServletRequestprotected String getAuthenticatedEntity(javax.servlet.http.HttpServletRequest request)
request
, or null if there is no authenticated entity.request
- Requestrequest
, or null if there is no authenticated entity.protected void setAuthenticatedEntity(javax.servlet.http.HttpServletRequest request, String name)
request
- Requestname
- the name of the authenticated entityprotected abstract String getEntityAttributeKey()
protected abstract String getAuthenticationErrorMessage()
protected abstract String getBasicRealm()
Copyright © 2013 Atlassian. All Rights Reserved.