com.plumtree.uiinfrastructure.login
Class HTTPBasicAuthenticator

java.lang.Object
  extended by com.plumtree.uiinfrastructure.login.HTTPBasicAuthenticator
All Implemented Interfaces:
IAuthenticator

public class HTTPBasicAuthenticator
extends java.lang.Object
implements IAuthenticator

The authentication module for HTTP Basic authentication.

Author:
DonH, WilliamA (Writing this new class)

Field Summary
static java.lang.String AUTH_CHALLENGE
          Internal string constants for basic auth challenge.
static java.lang.String AUTH_DOMAIN
           
static java.lang.String AUTHORIZATION_HEADER
          Internal string constants for decoding basic auth credentials.
static java.lang.String BASIC_AUTH
           
static java.lang.String[] BASIC_AUTH_ENCODINGS_ORDERED
          Ordered with most common first (win-1252 latin characters).
static java.lang.String LOGIN_ATTEMPTS
          Key to data stored on the HTTP Session
static int MAX_LOGIN_ATTEMPTS
           
 
Method Summary
static LoginResult DoBasicAuthLogin(RequestData tempData)
          Helper method for basic auth login.
static int GetBasicAuthCookieExpiration(RequestData _tempData)
          Helper method to get the basic auth cookie expiration value from the config files.
 boolean GetBasicAuthOverrideSSO(RequestData _tempData)
          Helper method to determine whether or not we should use an HTTP basic auth challenge to authenticate the user.
static HTTPBasicAuthenticator GetInstance()
           
 Redirect GetOrSendLoginChallenge(RequestData requestData)
          Sends an HTTP Basic authentication challenge.
 boolean IsBasicAuthURL(java.lang.String strURL)
           
 LoginResult Login(RequestData requestData)
          Performs login using HTTP basic authentication credentials in the request header.
 boolean Logout(RequestData requestData)
          Logout is handled by the ILoginControl in the Login AS.
static void SendBasicAuthChallenge(RequestData _tempData)
          Helper method to send an HTTP basic auth challenge to authenticate the user.
 boolean UseThisAuth(RequestData requestData)
          Helper method to determine whether or not we should use an HTTP basic auth challenge to authenticate the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTH_CHALLENGE

public static final java.lang.String AUTH_CHALLENGE
Internal string constants for basic auth challenge. Note that the AUTH_CHALLENGE string cannot come between /gateway and /PTARGS_ or the gateway code will not work. The AUTH_CHALLENGE string must also come immediately after the HTTP entry point (server.pt).

See Also:
Constant Field Values

AUTH_DOMAIN

public static final java.lang.String AUTH_DOMAIN
See Also:
Constant Field Values

AUTHORIZATION_HEADER

public static final java.lang.String AUTHORIZATION_HEADER
Internal string constants for decoding basic auth credentials.

See Also:
Constant Field Values

BASIC_AUTH

public static final java.lang.String BASIC_AUTH
See Also:
Constant Field Values

BASIC_AUTH_ENCODINGS_ORDERED

public static final java.lang.String[] BASIC_AUTH_ENCODINGS_ORDERED
Ordered with most common first (win-1252 latin characters).


LOGIN_ATTEMPTS

public static final java.lang.String LOGIN_ATTEMPTS
Key to data stored on the HTTP Session

See Also:
Constant Field Values

MAX_LOGIN_ATTEMPTS

public static final int MAX_LOGIN_ATTEMPTS
See Also:
Constant Field Values
Method Detail

GetInstance

public static HTTPBasicAuthenticator GetInstance()

Login

public LoginResult Login(RequestData requestData)
Performs login using HTTP basic authentication credentials in the request header.

Specified by:
Login in interface IAuthenticator
Parameters:
requestData - the request
Returns:
The LoginResult, or null if login is not attempted (since the request appears to be not for HTTP Basic auth).
See Also:
com.plumtree.uiinfrastructure.login.IAuthenticator#Login(com.plumtree.uiinfrastructure.application.RequestData)

GetOrSendLoginChallenge

public Redirect GetOrSendLoginChallenge(RequestData requestData)
Sends an HTTP Basic authentication challenge.

Specified by:
GetOrSendLoginChallenge in interface IAuthenticator
Parameters:
requestData - the request
Returns:
the Redirect to the login page, or null if the login challenge has been sent out directly using the XPResponse in the requestData.
See Also:
com.plumtree.uiinfrastructure.login.IAuthenticator#GetOrSendLoginChallenge()

Logout

public boolean Logout(RequestData requestData)
Logout is handled by the ILoginControl in the Login AS. This method returns false to indicate no logout action has been performed.

Specified by:
Logout in interface IAuthenticator
Parameters:
requestData - the request
Returns:
a boolean indicating whether the user has been logged out (and/or redirected to a logout URL) or not. If it is true, the Interpreter shall not do any further processing of the request.
See Also:
com.plumtree.uiinfrastructure.login.IAuthenticator#Logout(com.plumtree.uiinfrastructure.application.RequestData)

UseThisAuth

public boolean UseThisAuth(RequestData requestData)
Helper method to determine whether or not we should use an HTTP basic auth challenge to authenticate the user.

Specified by:
UseThisAuth in interface IAuthenticator
Parameters:
requestData -
Returns:
a boolean indicating whether the authentication method is applicable to the request in the requestData

IsBasicAuthURL

public boolean IsBasicAuthURL(java.lang.String strURL)

DoBasicAuthLogin

public static LoginResult DoBasicAuthLogin(RequestData tempData)
Helper method for basic auth login.

Parameters:
RequestData - the data for this HTTPRequest
Returns:
boolean true implies login was successful

GetBasicAuthOverrideSSO

public boolean GetBasicAuthOverrideSSO(RequestData _tempData)
Helper method to determine whether or not we should use an HTTP basic auth challenge to authenticate the user.

Parameters:
_tempData -

GetBasicAuthCookieExpiration

public static int GetBasicAuthCookieExpiration(RequestData _tempData)
Helper method to get the basic auth cookie expiration value from the config files. Logs an error and returns a reasonable default value if there are problems.

Parameters:
_tempData -
Returns:
int nExpiration in seconds

SendBasicAuthChallenge

public static void SendBasicAuthChallenge(RequestData _tempData)
Helper method to send an HTTP basic auth challenge to authenticate the user. The calling method should exit without setting a response after calling this method.

Parameters:
_tempData -



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.