org.mmbase.security.implementation.cloud
Class Authenticate
java.lang.Object
org.mmbase.security.Configurable
org.mmbase.security.Authentication
org.mmbase.security.implementation.cloud.Authenticate
- All Implemented Interfaces:
- AuthenticationData
public class Authenticate
- extends Authentication
Very simply security from within MMBase. You might want to look at Cloud Context Security which offers a much more powerful implementation.
- Version:
- $Id: Authenticate.java 41999 2010-04-20 17:47:40Z michiel $
- Author:
- Eduard Witteveen, Michiel Meeuwissen
| Fields inherited from interface org.mmbase.security.AuthenticationData |
METHOD_ANONYMOUS, METHOD_ASIS, METHOD_DEFAULT, METHOD_DELEGATE, METHOD_HTTP, METHOD_LOGINPAGE, METHOD_LOGOUT, METHOD_PAGELOGON, METHOD_SESSIONDELEGATE, METHOD_SESSIONLOGON, METHOD_UNSET, PARAMETER_AUTHENTICATE, PARAMETER_LOGOUT, PARAMETER_PASSWORD, PARAMETER_RANK, PARAMETER_SESSIONNAME, PARAMETER_USERNAME, PARAMETER_USERNAMES, STORES_CONTEXT_IN_OWNER, STRINGS |
|
Method Summary |
protected Rank |
getRank(String userName)
Gets rank from user |
boolean |
isValid(UserContext usercontext)
The method returns whether the UserContext has become invalid for some reason (change in security config?) |
protected void |
load()
This method should be overridden by an extending class. |
UserContext |
login(String moduleName,
Map loginInfo,
Object[] parameters)
This method will verify the login, and give a UserContext back if the login procedure was successful. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Authenticate
public Authenticate()
load
protected void load()
- This method should be overridden by an extending class. It should further initialize the
class. It can optionally retrieve settings from the general security configuration file
(available as the 'configResource' member). Security implementations with complicated
configuration would typically retrieve a path to their own configuration file only.
Implementation is empty here.
- Specified by:
load in class Configurable
getRank
protected Rank getRank(String userName)
- Gets rank from user
- Parameters:
userName - account name of user
- Returns:
- Rank of the user
- Since:
- MMBase-1.8
login
public UserContext login(String moduleName,
Map loginInfo,
Object[] parameters)
throws SecurityException
- 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'.
Possible values are returned by Authentication.getTypes().
This is also called 'authentication', or '(authentication) type' in
several contextes.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). This Map can (or must) be supplied by
Authentication.createParameters(java.lang.String) (using the setter-methods and the Parameters.toMap(java.util.Map) method of the resulting Parameters object).parameters - A list of optional parameters, may also (and will often) be null.
- Returns:
null if no valid credentials were supplied, a (perhaps new) UserContext if login succeeded.
- Throws:
SecurityException - When something strange happened, or authentication was unsuccessful.
isValid
public boolean isValid(UserContext usercontext)
throws SecurityException
- The method returns whether the UserContext has become invalid for some reason (change in security config?)
- Parameters:
usercontext - The UserContext of which we want to know the rights
- Returns:
true when valid, otherwise false
- Throws:
SecurityException - When something strange happened
MMBase 2.0-SNAPSHOT - null