|
||||||||||
| 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.cloudcontext.CloudContextAuthentication
org.mmbase.security.implementation.aselect.ASelectAuthentication
public class ASelectAuthentication
ASelect Authentication implementation for MMBase based on the ASelect agent. See http://aselect.surfnet.
| Field Summary | |
|---|---|
protected Parameter[] |
CREDENTIALS
|
protected Parameter[] |
LOGOUT
|
static String |
NAMESPACE
|
static String |
XSD
|
static String |
XSD_LOC
|
| Fields inherited from class org.mmbase.security.Authentication |
|---|
attributes, PARAMETERS_ANONYMOUS, PARAMETERS_NAME_PASSWORD, PARAMETERS_USERS |
| Fields inherited from class org.mmbase.security.Configurable |
|---|
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, STORES_CONTEXT_IN_OWNER, 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. |
protected Rank |
getRank(String userName)
|
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 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.implementation.cloudcontext.CloudContextAuthentication |
|---|
getInstance, getUserBuilder, getUserProvider |
| Methods inherited from class org.mmbase.security.Authentication |
|---|
getAttribute, getKey, getMethod, getMethod, getNode, 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 |
|---|
public static final String XSD
public static final String XSD_LOC
public static final String NAMESPACE
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'.
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.
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
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 Authenticationprotocol - For which protocol or null, which means 'for HTTP/1.1'.public 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) can be used as the second argument
for Authentication.login(java.lang.String, java.util.Map, 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 Authenticationpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||