public interface AuthenticationData
CloudContext.getAuthentication().| Modifier and Type | Field and Description |
|---|---|
static int |
METHOD_ANONYMOUS
Requests an 'anonymous' cloud, with a user with no credentials.
|
static int |
METHOD_ASIS
Use the authenticated user which is stored in the session, or if no such user can be found,
try to supply 'anonymous'.
|
static int |
METHOD_DEFAULT |
static int |
METHOD_DELEGATE
Delegates authentication completely to the authentication implementation.
|
static int |
METHOD_HTTP
Use Http 'Basic' authentication.
|
static int |
METHOD_LOGINPAGE
Use a dedicated 'login' jsp, to log in.
|
static int |
METHOD_LOGOUT
Remove the authenticated user from the session, and otherwise invalidate the user if
necessary (e.g.
|
static int |
METHOD_PAGELOGON
Login with given credentials (only Strings), and don't store this any where (except for the current 'page').
|
static int |
METHOD_SESSIONDELEGATE
Delegates authentication completely to the authentication implementation
METHOD_DELEGATE, but stores the authenticated in the session then. |
static int |
METHOD_SESSIONLOGON
Logon with given credentials (only Strings), and don't store this in the session.
|
static int |
METHOD_UNSET |
static Parameter<String> |
PARAMETER_AUTHENTICATE |
static Parameter<Boolean> |
PARAMETER_LOGOUT |
static Parameter<String> |
PARAMETER_PASSWORD |
static Parameter<Rank> |
PARAMETER_RANK |
static Parameter<String> |
PARAMETER_SESSIONNAME |
static Parameter<String> |
PARAMETER_USERNAME
Common parameters for login-info.
|
static Parameter<List> |
PARAMETER_USERNAMES |
static String |
STORES_CONTEXT_IN_OWNER |
static String |
STRINGS
Resourcebundle containing all kind of i18n versions of parameter names and so on.
|
| Modifier and Type | Method and Description |
|---|---|
Parameters |
createParameters(String application)
For a given authentication type returns a parameters object to fill with credentials.
|
Object |
getAttribute(String name)
Allows the user to retrieve specific attributes on the underlying implementation.
|
int |
getDefaultMethod(String protocol)
The security implementation can override a default method.
|
int |
getMethod(String m)
Several 'methods' to authenticate could be available.
|
int |
getNode(UserContext userContext)
This method returns an MMBase node that corresponds with the given UserContext
|
String[] |
getTypes()
Gives all available authentication types.
|
String[] |
getTypes(int method)
For a given method, returns the available 'applications'.
|
String |
getUserBuilder()
This method returns the builder name of the nodes that will be returned by the
getNode(UserContext) call. |
boolean |
isValid(UserContext userContext)
The method returns whether the UserContext has become invalid for some reason (change in security config?)
|
static final int METHOD_UNSET
static final int METHOD_ANONYMOUS
static final int METHOD_DELEGATE
createParameters(java.lang.String) can accept that) which can be used for user-interaction.static final int METHOD_PAGELOGON
static final int METHOD_HTTP
static final int METHOD_ASIS
static final int METHOD_LOGOUT
static final int METHOD_LOGINPAGE
static final int METHOD_SESSIONDELEGATE
METHOD_DELEGATE, but stores the authenticated in the session then. A second request with
this method will simply use the session.static final int METHOD_SESSIONLOGON
static final int METHOD_DEFAULT
static final String STRINGS
Authentication (because no static blocks allowed in interface).static final Parameter<String> PARAMETER_USERNAME
static final String STORES_CONTEXT_IN_OWNER
boolean isValid(UserContext userContext) throws SecurityException
userContext - The UserContext of which we want to know the rightstrue when valid, otherwise falseSecurityException - When something strange happenedint getNode(UserContext userContext) throws SecurityException
UnsupportedOperationException - If the current authentication implementation does
not associate UserContext's with MMBase nodes at all.SecurityExceptionString getUserBuilder()
getNode(UserContext) call.UnsupportedOperationException - If the current authentication implementation does
not associate user with MMBase nodes at all.int getMethod(String m)
Several 'methods' to authenticate could be available. A method is a kind of protocol which must be used to authenticate some body.
Not all authentication methods may be applicable for all communication protocols (like http, https etc).
This method converts a user-friendly string describing the 'method' to a integer constant which can be used in
getTypes(int).
m - A String like 'http', 'anonymous', 'loginpage', or 'delegatesession'.METHOD_DELEGATE, METHOD_PAGELOGON,
METHOD_HTTP, METHOD_ASIS, METHOD_LOGOUT, METHOD_LOGINPAGE
METHOD_SESSIONDELEGATE, METHOD_SESSIONLOGON. This method was introduced
before java 1.5 (where the return type would more obviously be a AuthenticionMethod
enumeration).getDefaultMethod(java.lang.String)int getDefaultMethod(String protocol)
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).protocol - For which protocol or null, which means 'for HTTP/1.1'.String[] getTypes()
Gives all available authentication types. The first one can be used as the default. Typically, an implementation should at least support 'anonynmous' and 'class'.
Since most of the time we are using HTTP any way, types for the method METHOD_HTTP
('name/password' based) and method METHOD_LOGINPAGE (createParameters(java.lang.String) can
request anything presentable in a HTML-form) are common too.
String[] getTypes(int method)
For a given method, returns the available 'applications'. The first one can be used as the default.
Typically for the method METHOD_ANONYMOUS at least 'anonymous' must be returned, and
for METHOD_DELEGATE at least 'class'. Everything else is optional, because
are not generic.
Parameters createParameters(String application)
Parameters.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[]).MMBase 1.9-SNAPSHOT - ${javadoctimestamp}