velosurf.web.auth
Class SimpleDBAuthenticator

java.lang.Object
  extended by velosurf.web.auth.BaseAuthenticator
      extended by velosurf.web.auth.SimpleDBAuthenticator

public class SimpleDBAuthenticator
extends BaseAuthenticator

Authenticator basic implementation.

It accepts the four following parameters in toolbox.xml:

Author:
Claude Brisson

Field Summary
private  java.util.Map config
          configuration.
protected  DBReference db
          database.
private static java.lang.String LOGIN_PARAMETER_DEFAULT
          default name for the "login" parameter.
private static java.lang.String LOGIN_PARAMETER_KEY
          key used in toolbox.xml to indicate the name of the login parameter in the "user by login" attribute.
private  java.lang.String loginParameter
          login parameter name
private static java.lang.String PASSWORD_FIELD_DEFAULT
          default name of the "password" field.
private static java.lang.String PASSWORD_FIELD_KEY
          key used in toolbox.xml to indicate the name of the password field in the "user by login" attribute.
private  java.lang.String passwordField
          password field name
private static java.lang.String USER_BY_LOGIN_DEFAULT
          default name of the "user by login" root attribute.
private static java.lang.String USER_BY_LOGIN_KEY
          key used in toolbox.xml to indicate the "user by login" root attribute.
private  java.lang.String userByLogin
          "user by login" root attribute name.
 
Constructor Summary
SimpleDBAuthenticator()
           
 
Method Summary
 void configure(java.util.Map map)
          configure this tool.
 java.lang.String getPassword(java.lang.String login)
          get the password for this login.
 java.lang.Object getUser(java.lang.String login)
          get the user object for this login.
 void init(java.lang.Object initData)
          initialize this tool.
protected  void initDB(javax.servlet.ServletContext ctx)
           
 void setDBReference(DBReference db)
          externally set the db reference
 
Methods inherited from class velosurf.web.auth.BaseAuthenticator
checkLogin, getChallenge, getLoggedUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

db

protected DBReference db
database.


USER_BY_LOGIN_KEY

private static final java.lang.String USER_BY_LOGIN_KEY
key used in toolbox.xml to indicate the "user by login" root attribute.

See Also:
Constant Field Values

LOGIN_PARAMETER_KEY

private static final java.lang.String LOGIN_PARAMETER_KEY
key used in toolbox.xml to indicate the name of the login parameter in the "user by login" attribute.

See Also:
Constant Field Values

PASSWORD_FIELD_KEY

private static final java.lang.String PASSWORD_FIELD_KEY
key used in toolbox.xml to indicate the name of the password field in the "user by login" attribute.

See Also:
Constant Field Values

USER_BY_LOGIN_DEFAULT

private static final java.lang.String USER_BY_LOGIN_DEFAULT
default name of the "user by login" root attribute.

See Also:
Constant Field Values

LOGIN_PARAMETER_DEFAULT

private static final java.lang.String LOGIN_PARAMETER_DEFAULT
default name for the "login" parameter.

See Also:
Constant Field Values

PASSWORD_FIELD_DEFAULT

private static final java.lang.String PASSWORD_FIELD_DEFAULT
default name of the "password" field.

See Also:
Constant Field Values

config

private java.util.Map config
configuration.


userByLogin

private java.lang.String userByLogin
"user by login" root attribute name.


loginParameter

private java.lang.String loginParameter
login parameter name


passwordField

private java.lang.String passwordField
password field name

Constructor Detail

SimpleDBAuthenticator

public SimpleDBAuthenticator()
Method Detail

init

public void init(java.lang.Object initData)
initialize this tool.

Overrides:
init in class BaseAuthenticator
Parameters:
initData - a view context

initDB

protected void initDB(javax.servlet.ServletContext ctx)

setDBReference

public void setDBReference(DBReference db)
externally set the db reference

Parameters:
db - DBReference

getPassword

public java.lang.String getPassword(java.lang.String login)
get the password for this login.

Specified by:
getPassword in class BaseAuthenticator
Parameters:
login - login
Returns:
password or null

getUser

public java.lang.Object getUser(java.lang.String login)
get the user object for this login.

Specified by:
getUser in class BaseAuthenticator
Parameters:
login - login
Returns:
user object

configure

public void configure(java.util.Map map)
configure this tool.

Overrides:
configure in class BaseAuthenticator
Parameters:
map -


~ooOoo~