org.mmbase.security.implementation.context
Class ContextAuthentication

java.lang.Object
  extended byorg.mmbase.security.Configurable
      extended byorg.mmbase.security.Authentication
          extended byorg.mmbase.security.implementation.context.ContextAuthentication

public class ContextAuthentication
extends Authentication

Authentication based on a XML-configuration file. The XML file contains besides users, groups and contexts (used for ContextAuthorization).

Version:
$Id: ContextAuthentication.java,v 1.14 2003/08/27 19:37:12 michiel Exp $
Author:
Eduard Witteveen
See Also:
ContextAuthorization

Field Summary
static java.lang.String DTD_SECURITY_CONTEXT_CONFIG_1_0
          DTD resource filename of the Builder DTD version 1.0
static java.lang.String DTD_SECURITY_CONTEXT_CONFIG_1_1
           
static java.lang.String DTD_SECURITY_CONTEXT_CONFIG_1_2
           
static java.lang.String PUBLIC_ID_SECURITY_CONTEXT_CONFIG_1_0
          Public ID of the Builder DTD version 1.0
static java.lang.String PUBLIC_ID_SECURITY_CONTEXT_CONFIG_1_1
           
static java.lang.String PUBLIC_ID_SECURITY_CONTEXT_CONFIG_1_2
           
 
Fields inherited from class org.mmbase.security.Configurable
configFile, fileWatcher, manager
 
Constructor Summary
ContextAuthentication()
           
 
Method Summary
 boolean isValid(UserContext usercontext)
          this method does nothing..
protected  void load()
          This method should be overrided by an extending class.
 UserContext login(java.lang.String moduleName, java.util.Map loginInfo, java.lang.Object[] parameters)
          This method will verify the login, and give a UserContext back if the login procedure was successful.
 
Methods inherited from class org.mmbase.security.Configurable
load
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC_ID_SECURITY_CONTEXT_CONFIG_1_0

public static final java.lang.String PUBLIC_ID_SECURITY_CONTEXT_CONFIG_1_0
Public ID of the Builder DTD version 1.0

See Also:
Constant Field Values

PUBLIC_ID_SECURITY_CONTEXT_CONFIG_1_1

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

PUBLIC_ID_SECURITY_CONTEXT_CONFIG_1_2

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

DTD_SECURITY_CONTEXT_CONFIG_1_0

public static final java.lang.String DTD_SECURITY_CONTEXT_CONFIG_1_0
DTD resource filename of the Builder DTD version 1.0

See Also:
Constant Field Values

DTD_SECURITY_CONTEXT_CONFIG_1_1

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

DTD_SECURITY_CONTEXT_CONFIG_1_2

public static final java.lang.String DTD_SECURITY_CONTEXT_CONFIG_1_2
See Also:
Constant Field Values
Constructor Detail

ContextAuthentication

public ContextAuthentication()
Method Detail

load

protected void load()
Description copied from class: Configurable
This method should be overrided by an extending class. It should further initialize the class. It can optionally retrieve settings from the general security configuration file (available as the 'configFile' member). Security implementations with complicated configuration would typically retrieve a path to their own configuration file only.

Specified by:
load in class Configurable

login

public UserContext login(java.lang.String moduleName,
                         java.util.Map loginInfo,
                         java.lang.Object[] parameters)
                  throws SecurityException
Description copied from class: Authentication
This method will verify the login, and give a UserContext back if the login procedure was successful.

Specified by:
login in class Authentication
Parameters:
moduleName - A String that further specifies the login method (one implementation could handle more then one methods) A typical value might be 'username/password'.
loginInfo - A Map containing the credentials or other objects which might be used to obtain them (e.g. request/response objects). It might also be 'null', in which case your implementation normally should return the 'anonymous' user (or null, if no such user can be defined).
parameters - A list of optional parameters, may also (and will often) be null.
Returns:
nullThrows:
SecurityException - When something strang happened

isValid

public boolean isValid(UserContext usercontext)
                throws SecurityException
this method does nothing..

Specified by:
isValid in class Authentication
Parameters:
usercontext - The UserContext of which we want to know the rights
Returns:
true when valid, otherwise false
Throws:
SecurityException - When something strang happend


MMBase build 1.7.4.20050922