|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.security.Configurable
org.mmbase.security.Authentication
org.mmbase.security.implementation.aselect.ASelectAuthentication
ASelect Authentication implementation for MMBase based on the ASelect agent. See http://aselect.surfnet.
| Field Summary | |
protected Parameter[] |
CREDENTIALS
|
protected Parameter[] |
LOGOUT
|
| Fields inherited from class org.mmbase.security.Authentication |
PARAMETERS_ANONYMOUS, PARAMETERS_NAME_PASSWORD, PARAMETERS_USERS |
| Fields inherited from class org.mmbase.security.Configurable |
configFile, configResource, configWatcher, manager |
| 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, STRINGS |
| Constructor Summary | |
ASelectAuthentication()
|
|
| Method Summary | |
protected Map |
authenticate(HttpServletRequest request,
HttpServletResponse response,
String application,
String user)
|
protected boolean |
authentication(HttpServletRequest request,
HttpServletResponse response,
String application,
String requestedUser)
Performs the work of authentication and session management. |
protected void |
configureByProperties(String agentConf)
A-Select 1.3 backwards compatibility |
static Map |
convertCGIMessage(String message)
This method will convert a string of key=value&key=value
etc. |
Parameters |
createParameters(String application)
For a given authentication type returns a parameters object to fill with credentials. |
protected UserContext |
getAnonymousUser()
|
protected String |
getAppUrl(HttpServletRequest request,
HttpServletResponse response)
Returns an URL for the the current request. |
protected String |
getASelectOrganization(HttpServletRequest request)
Retrieves the A-Select Organization Id from the cookies. |
protected String |
getASelectSessionId(HttpServletRequest request)
Retrieves the A-Select Session Id from the cookies. |
protected String |
getASelectUserId(HttpServletRequest request)
Retrieves the A-Select User Id from the cookies. |
int |
getDefaultMethod(String protocol)
The security implementation can override a default method. The default default method (as implemented in Authentication for the 'http' protocol is HTTP
(which means that basic authentication of the http protocol can be used), but may not be
feasible for every implementation (it is e.g. useless if the security implementation does not have
name/password authentication). |
protected Rank |
getRank(String userName)
|
String[] |
getTypes(int method)
For a given method, returns the available 'applications'. The first one can be used as the default. |
boolean |
isValid(UserContext userContext)
The method returns wether the UserContext has become invalid for some reason (change in security config?) |
protected void |
load()
This method should be overrided by an extending class. |
UserContext |
login(String application,
Map loginInfo,
Object[] parameters)
This method will verify the login, and give a UserContext back if the login procedure was successful. |
protected void |
logout(HttpServletRequest request,
HttpServletResponse response,
String application)
Processes the logout of a user. |
protected void |
logoutASelectServer(HttpServletRequest request,
HttpServletResponse response,
String application)
|
static void |
main(String[] args)
|
| Methods inherited from class org.mmbase.security.Authentication |
getKey, getMethod, getTypes |
| 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 |
protected final Parameter[] CREDENTIALS
protected final Parameter[] LOGOUT
| Constructor Detail |
public ASelectAuthentication()
| Method Detail |
protected void configureByProperties(String agentConf)
protected void load()
Configurable
load in class Configurableprotected UserContext getAnonymousUser()
protected Rank getRank(String userName)
public UserContext login(String application,
Map loginInfo,
Object[] parameters)
throws SecurityException
Authentication
login in class Authenticationapplication - 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.
nullThrows:
SecurityException - When something strang happened
public boolean isValid(UserContext userContext)
throws SecurityException
AuthenticationData
userContext - The UserContext of which we want to know the rights
true when valid, otherwise false
SecurityException - When something strange happened
protected String getAppUrl(HttpServletRequest request,
HttpServletResponse response)
protected Map authenticate(HttpServletRequest request,
HttpServletResponse response,
String application,
String user)
throws org.aselect.system.exception.ASelectCommunicationException,
IOException
org.aselect.system.exception.ASelectCommunicationException
IOException
protected boolean authentication(HttpServletRequest request,
HttpServletResponse response,
String application,
String requestedUser)
request - the current HTTP request. Used to obtain the parameters
for authentication.response - the current HTTP response
ASelectException - If the module could not perform the authenticate requestprotected String getASelectUserId(HttpServletRequest request)
request - the current HTTP request. Used to obtain the cookie(s)
protected String getASelectOrganization(HttpServletRequest request)
request - the current HTTP request. Used to obtain the cookie(s)
protected String getASelectSessionId(HttpServletRequest request)
request - the current HTTP request. Used to obtain the cookie(s)
protected void logoutASelectServer(HttpServletRequest request,
HttpServletResponse response,
String application)
throws SecurityException
SecurityException
protected void logout(HttpServletRequest request,
HttpServletResponse response,
String application)
throws SecurityException
request - the current HTTP requestresponse - the current HTTP response.
SecurityExceptionpublic static Map convertCGIMessage(String message)
key=value&key=value
etc. tuples (aka a CGI request string) into a hashtable for much easier
processing.
public int getDefaultMethod(String protocol)
AuthenticationAuthentication for the 'http' protocol is HTTP
(which means that basic authentication of the http protocol can be used), but may not be
feasible for every implementation (it is e.g. useless if the security implementation does not have
name/password authentication).
getDefaultMethod in interface AuthenticationDatagetDefaultMethod in class Authenticationpublic String[] getTypes(int method)
Authentication
getTypes in interface AuthenticationDatagetTypes in class Authenticationpublic Parameters createParameters(String application)
AuthenticationDataParameters.toMap() can be used as the second argument
for Authentication.login(java.lang.String, java.util.Map, java.lang.Object[])
createParameters in interface AuthenticationDatacreateParameters in class Authenticationpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||