com.atlassian.crowd.plugin.rest.filter
Class BasicApplicationAuthenticationFilter
java.lang.Object
com.atlassian.crowd.plugin.rest.filter.AbstractBasicAuthenticationFilter
com.atlassian.crowd.plugin.rest.filter.BasicApplicationAuthenticationFilter
- All Implemented Interfaces:
- javax.servlet.Filter
public class BasicApplicationAuthenticationFilter
- extends AbstractBasicAuthenticationFilter
Implementation of HTTP Basic Authentication such that all invocations
to the filter must be authenticated with a valid application name
and corresponding password.
As a performance enhancement the application name is saved in the
session after a successful authentication. Password check is waived
with consequent requests when the application name in the request
matches the application name in the session. Clients wishing to take
advantage of this feature must support cookies.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicApplicationAuthenticationFilter
public BasicApplicationAuthenticationFilter(ApplicationManager applicationManager,
ClientValidationManager clientValidationManager,
TokenAuthenticationManager tokenAuthenticationManager)
doFilter
public void doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
isAuthenticated
protected boolean isAuthenticated(javax.servlet.http.HttpServletRequest request,
AbstractBasicAuthenticationFilter.Credentials credentials)
- Decorates the parent behaviour to check also the validity of the token
- Overrides:
isAuthenticated in class AbstractBasicAuthenticationFilter
- Parameters:
request - HTTP servlet request possibly containing a HttpSessioncredentials - credentials sent with the request
- Returns:
true is the application is authenticated
getAuthenticatedEntity
protected String getAuthenticatedEntity(javax.servlet.http.HttpServletRequest request)
- Returns the authenticated entity from the
request, or null if there is no authenticated entity.
- Overrides:
getAuthenticatedEntity in class AbstractBasicAuthenticationFilter
- Parameters:
request - Request
- Returns:
- authenticated entity from the
request, or null if there is no authenticated entity.
setAuthenticatedEntity
protected void setAuthenticatedEntity(javax.servlet.http.HttpServletRequest request,
String name)
- Sets the authenticated entity.
- Overrides:
setAuthenticatedEntity in class AbstractBasicAuthenticationFilter
- Parameters:
request - Requestname - the name of the authenticated entity
getEntityAttributeKey
protected String getEntityAttributeKey()
- Specified by:
getEntityAttributeKey in class AbstractBasicAuthenticationFilter
getAuthenticationErrorMessage
protected String getAuthenticationErrorMessage()
- Specified by:
getAuthenticationErrorMessage in class AbstractBasicAuthenticationFilter
getBasicRealm
protected String getBasicRealm()
- Specified by:
getBasicRealm in class AbstractBasicAuthenticationFilter
Copyright © 2014 Atlassian. All Rights Reserved.