velosurf.web.auth
Class BaseAuthenticator

java.lang.Object
  extended by velosurf.web.auth.BaseAuthenticator
Direct Known Subclasses:
SimpleDBAuthenticator

public abstract class BaseAuthenticator
extends java.lang.Object

This abstract class implements an authentication mechanism. It is meant to be declared in toolbox.xml as a session-scoped tool. The password encryption method can be specified in toolbox.xml using the method parameter (when not specified, passwords are passed in clear). You will need to implement the same password encryption on the client side using the adequate javascript files. A /src/javascript/md5.js file is provided to help implementing the HmacMD5 method. Still, if you really want security, use HTTPS!

Author:
Claude Brisson

Field Summary
private static java.util.Random _random
           
private  java.lang.String challenge
           
private static int CHALLENGE_LENGTH
           
private  java.lang.String method
           
 
Constructor Summary
BaseAuthenticator()
           
 
Method Summary
 boolean checkLogin(java.lang.String login, java.lang.String answer)
           
 void configure(java.util.Map config)
           
private  java.lang.String generateAnswer(java.lang.String password)
           
 java.lang.String getChallenge()
          This method generates a new challenge each time it is called.
protected abstract  java.lang.String getPassword(java.lang.String login)
           
protected abstract  java.lang.Object getUser(java.lang.String login)
           
 void init(java.lang.Object initData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

method

private java.lang.String method

challenge

private java.lang.String challenge

_random

private static java.util.Random _random

CHALLENGE_LENGTH

private static final int CHALLENGE_LENGTH
See Also:
Constant Field Values
Constructor Detail

BaseAuthenticator

public BaseAuthenticator()
Method Detail

getPassword

protected abstract java.lang.String getPassword(java.lang.String login)

getUser

protected abstract java.lang.Object getUser(java.lang.String login)

init

public void init(java.lang.Object initData)

configure

public void configure(java.util.Map config)

getChallenge

public java.lang.String getChallenge()
This method generates a new challenge each time it is called.

Returns:
a new 1024-bit challenge in base64

checkLogin

public boolean checkLogin(java.lang.String login,
                          java.lang.String answer)

generateAnswer

private java.lang.String generateAnswer(java.lang.String password)


~ooOoo~