public class Authenticate extends CloudContextAuthentication
| Modifier and Type | Class and Description |
|---|---|
class |
Authenticate.AdminVirtualNode |
protected class |
Authenticate.LocalAdmin |
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ADMINS_PROPS |
protected static Map<String,User> |
loggedInExtraAdmins |
attributes, PARAMETERS_ANONYMOUS, PARAMETERS_NAME_PASSWORD, PARAMETERS_USERSconfigResource, configWatcher, managerMETHOD_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| Constructor and Description |
|---|
Authenticate() |
| Modifier and Type | Method and Description |
|---|---|
Parameters |
createParameters(String application)
For a given authentication type returns a parameters object to fill with credentials.
|
static User |
getLoggedInExtraAdmin(String userName) |
int |
getNode(UserContext user)
This method returns an MMBase node that corresponds with the given UserContext
|
String[] |
getTypes(int method)
For a given method, returns the available 'applications'.
|
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 type,
Map<String,?> map,
Object[] parameters)
This method will verify the login, and give a UserContext back if the login procedure was successful.
|
protected void |
readAdmins(InputStream in) |
getInstance, getUserBuilder, getUserProvidergetAttribute, getDefaultMethod, getKey, getMethod, getMethod, getTypesloadprotected static final String ADMINS_PROPS
protected void readAdmins(InputStream in)
protected void load()
throws SecurityException
load in class ConfigurableSecurityExceptionpublic int getNode(UserContext user) throws SecurityException
AuthenticationgetNode in interface AuthenticationDatagetNode in class AuthenticationSecurityExceptionpublic UserContext login(String type, Map<String,?> map, Object[] parameters) throws SecurityException
| client provided | database | application to use | comments |
|---|---|---|---|
| plain | encoded | name/password | this is the default and most sensible case |
| encoded | encoded | name/encodedpassword | The 'allowencodedpassword' property must be true for this to work. |
| plain | plain | name/password | this is the default if the password set-processor is empty. |
| encoded | plain | name/encodedpassword |
login in class Authenticationtype - 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.map - 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<java.lang.String, java.lang.Object>) method of the resulting Parameters object).parameters - A list of optional parameters, may also (and will often) be null.null if no valid credentials were supplied, a (perhaps new) UserContext if login succeeded.SecurityException - When something strange happened, or authentication was unsuccessful.public boolean isValid(UserContext userContext) throws SecurityException
AuthenticationDatauserContext - The UserContext of which we want to know the rightstrue when valid, otherwise falseSecurityException - When something strange happenedpublic String[] getTypes(int method)
AuthenticationFor a given method, returns the available 'applications'. The first one can be used as the default.
Typically for the method AuthenticationData.METHOD_ANONYMOUS at least 'anonymous' must be returned, and
for AuthenticationData.METHOD_DELEGATE at least 'class'. Everything else is optional, because
are not generic.
getTypes in interface AuthenticationDatagetTypes in class Authenticationpublic Parameters createParameters(String application)
AuthenticationParameters.toMap(java.util.Map<java.lang.String, java.lang.Object>) can be used as the second argument
for Authentication.login(java.lang.String, java.util.Map<java.lang.String, ?>, java.lang.Object[])
Given a certain 'application' this will return a Parameters
which tells you exactly which parameters you can and must supply to Authentication.login(String, java.util.Map, Object[]).createParameters in interface AuthenticationDatacreateParameters in class AuthenticationMMBase 1.9-SNAPSHOT - ${javadoctimestamp}