com.atlassian.seraph.filter
Class PasswordBasedLoginFilter

java.lang.Object
  extended by com.atlassian.seraph.filter.BaseLoginFilter
      extended by com.atlassian.seraph.filter.PasswordBasedLoginFilter
All Implemented Interfaces:
javax.servlet.Filter
Direct Known Subclasses:
HttpAuthFilter, LoginFilter

public abstract class PasswordBasedLoginFilter
extends BaseLoginFilter

This is a base filter that logs the user in based on the given username and password. It is designed to be extended to support schemes that pass username and password one way or another.

For further info see superclass.

See Also:
BaseLoginFilter

Nested Class Summary
static class PasswordBasedLoginFilter.UserPasswordPair
          Represents a username password pair of user credentials.
 
Field Summary
 
Fields inherited from class com.atlassian.seraph.filter.BaseLoginFilter
ALREADY_FILTERED, AUTHENTICATION_ERROR_TYPE, LOGIN_ERROR, LOGIN_FAILED, LOGIN_NOATTEMPT, LOGIN_SUCCESS, OS_AUTHSTATUS_KEY
 
Constructor Summary
PasswordBasedLoginFilter()
           
 
Method Summary
protected abstract  PasswordBasedLoginFilter.UserPasswordPair extractUserPasswordPair(javax.servlet.http.HttpServletRequest request)
          Returns a username password pair for this request.
 String login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This implements the login method defined in BaseLoginFilter.login(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) and uses extracted user name and password to perform the check
 
Methods inherited from class com.atlassian.seraph.filter.BaseLoginFilter
destroy, doFilter, getAuthenticationContext, getAuthenticator, getElevatedSecurityGuard, getFilterConfig, getSecurityConfig, init, isAbsoluteUrl, redirectToOriginalDestination, setFilterConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordBasedLoginFilter

public PasswordBasedLoginFilter()
Method Detail

login

public String login(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
This implements the login method defined in BaseLoginFilter.login(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) and uses extracted user name and password to perform the check

Specified by:
login in class BaseLoginFilter
Parameters:
request - the HTTP request in play
response - the HTTP respone in play
Returns:
the login status string.

The possible statuses are:

  • LoginFilter.LOGIN_SUCCESS - the login was processed, and user was logged in
  • LoginFilter.LOGIN_FAILURE - the login was processed, the user gave a bad username or password
  • LoginFilter.LOGIN_ERROR - the login was processed, an exception occurred trying to log the user in
  • LoginFilter.LOGIN_NOATTEMPT - the login was no processed, no form parameters existed

extractUserPasswordPair

protected abstract PasswordBasedLoginFilter.UserPasswordPair extractUserPasswordPair(javax.servlet.http.HttpServletRequest request)
Returns a username password pair for this request. If this request does not contain user credentials - returns null;

Parameters:
request - the HTTP request in play
Returns:
user credentials or null


Copyright © 2013 Atlassian. All Rights Reserved.