public interface Authentication
QualifiedAgents. The second authentication requires an appropriate
organisational position, verifies the credentials again and returns client
session factories that in turn allow to access to the AristaFlow-Client-API
for normal users (via their client programs). The second authentication may
be done without the first one, in case one knows the organisational position
(for instance logging on programmatically.
The implementation of authentication consists of two components: the local security manager and the global security manager. Simple cases are just forwarded to the global security manager, complex authentication like Single Sign-On (SSO) requires the local security manager retrieving the appropriate user credentials. Due to the various alternatives for authentication (e.g. password-based, Kerberos, etc.) this interface is rather generic. Therefore each of its methods requires the name of an authentication method. The usual ones are defined and described in a separate interface.
Do not forget to log off if you do not need the session factory any longer! This invalidates your session factory and prevents messing with it.
| Modifier and Type | Method and Description |
|---|---|
java.util.List<QualifiedAgent> |
authenticate(java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
Authenticates the agent identified by the designated authentication data with the designated
authentication method.
|
ClientSessionFactory |
authenticate(java.lang.String agentName,
long orgPositionID,
java.lang.String password)
Identifies and authenticates a normal user via the corresponding name,
orgPosition and the password and returns an appropriate
ClientSessionFactory as which encapsulates the security
information for the designated agent. |
ClientSessionFactory |
authenticate(java.lang.String agentName,
long orgPositionID,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
Identifies and authenticates the designated agent by the corresponding name and ID referring to
the appropriate
QualifedAgent with the designated authentication method providing
the authentication method-specific data. |
ClientSessionFactory |
authenticate(java.lang.String agentName,
long orgPositionID,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler,
java.lang.String userSessionID)
Identifies and authenticates the designated agent by the corresponding name and ID referring to
the appropriate
QualifedAgent with the designated authentication method providing
the authentication method-specific data. |
ClientSessionFactory |
authenticate(java.lang.String agentName,
long orgPositionID,
java.lang.String password,
java.lang.String userSessionID)
Identifies and authenticates a normal user via the corresponding name,
orgPosition and the password and returns an appropriate
ClientSessionFactory as which encapsulates the security
information for the designated agent. |
java.util.List<QualifiedAgent> |
authenticate(java.lang.String agentName,
java.lang.String password)
Like the name implies, this method's job is to authenticate agents, i.e.
|
java.util.List<QualifiedAgent> |
authenticate(java.lang.String agentName,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
Authenticates the designated agent by the corresponding name with the designated authentication
method providing the authentication method-specific data.
|
ClientSessionFactory[] |
authenticateCombined(java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
Performs a combined authentication that is
authenticate(String, byte[], AFCallbackHandler) and
authenticate(String, long, String, byte[], AFCallbackHandler) or
authenticate(String, long, String, byte[], AFCallbackHandler, String) in one step. |
ClientSessionFactory[] |
authenticateCombined(java.lang.String agentName,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
Performs a combined authentication that is
authenticate(String, String, byte[], AFCallbackHandler) and
authenticate(String, long, String, byte[], AFCallbackHandler) or
authenticate(String, long, String, byte[], AFCallbackHandler, String) in one step. |
void |
logoff(SessionToken session)
Logs the agent off that is identified by the designated
SessionToken. |
java.util.List<QualifiedAgent> authenticate(java.lang.String agentName, java.lang.String password) throws AuthenticationException, DataSourceException
agentName - The (unique) name of the agent to authenticate.password - the Agent's passwordAuthenticationException - If the provided credentials are incorrect
or the system agent tries to authenticate, an
AuthenticationException will be thrown.DataSourceException - when an unrecoverable error occurs while
accessing the data sourcejava.util.List<QualifiedAgent> authenticate(java.lang.String agentName, java.lang.String method, byte[] authenticationData, AFCallbackHandler callbackHandler) throws AuthenticationException
AuthMethod. The designated callback handler allows the used authentication method to
request additional data while authenticating. For how to use this refer to
CallbackHandler and JAAS. For the used
method refer to the corresponding authentication method.agentName - The unique name of the agent to authenticate. This must not be null nor the
empty string.method - The authentication method to use for authentication. This must not be null nor
the empty string.authenticationData - The data required by the designated authentication method. Depending
on the authentication method this may be null or empty.callbackHandler - A handler for callbacks allowing the used authentication method to
request further data. This may be null in case no callbacks are required.AuthenticationException - If the designated agent cannot be authenticated by the
designated data with the designated authentication method and the callback handler,
an AuthenticationException will be thrown.java.util.List<QualifiedAgent> authenticate(java.lang.String method, byte[] authenticationData, AFCallbackHandler callbackHandler) throws AuthenticationException
AuthMethod. The
designated callback handler allows the used authentication method to request additional data
while authenticating. For how to use this refer to
CallbackHandler and JAAS. For the used
method refer to the corresponding authentication method.method - The authentication method to use for authentication. This must not be null.authenticationData - The data required by the designated authentication method. Depending
on the authentication method this may be null or empty.callbackHandler - A handler for callbacks allowing the used authentication method to
request further data. This may be null in case no callbacks are required.AuthenticationException - If the designated agent cannot be authenticated by the
designated data with the designated authentication method and the callback handler,
an AuthenticationException will be thrown.ClientSessionFactory authenticate(java.lang.String agentName, long orgPositionID, java.lang.String password) throws AuthenticationException, DataSourceException
ClientSessionFactory as which encapsulates the security
information for the designated agent. The returned client session factory
allows the agent to create session tokens that are needed to call the
AristaFlow-Client-API. agentName - The unique name of the agent to authenticate.orgPositionID - The ID of the organisational position for which the
user is to be logged on.password - The password of the user corresponding to the designated
name.AuthenticationException - If the password and/or the username are
incorrect, an AuthenticationException will be
thrown.DataSourceException - If an an unrecoverable error occurs while
accessing the data source containing the username and the
password, a DataSourceException will be thrown.ClientSessionFactory authenticate(java.lang.String agentName, long orgPositionID, java.lang.String method, byte[] authenticationData, AFCallbackHandler callbackHandler) throws AuthenticationException
QualifedAgent with the designated authentication method providing
the authentication method-specific data. For information on this data refer to
AuthMethod. The designated callback handler allows the used authentication method to
request additional data while authenticating. For how to use this refer to
CallbackHandler and JAAS.agentName - The unique name of the agent to authenticate. This must not be null nor the
empty string.orgPositionID - The ID of the organisational position of the corresponding
QualifedAgent.method - The authentication method to use for authentication. This must not be null nor
the empty string.authenticationData - The data required by the designated authentication method. Depending
on the authentication method this may be null or empty.callbackHandler - A handler for callbacks allowing the used authentication method to
request further data. This may be null in case no callbacks are required.AuthenticationException - If the designated agent cannot be authenticated by the
designated data with the designated authentication method and the callback handler or
the agent is not allowed to log on at the provided application, an
AuthenticationException will be thrown.ClientSessionFactory authenticate(java.lang.String agentName, long orgPositionID, java.lang.String password, java.lang.String userSessionID) throws AuthenticationException, DataSourceException
ClientSessionFactory as which encapsulates the security
information for the designated agent. The returned client session factory
allows the agent to create session tokens that are needed to call the
AristaFlow-Client-API. agentName - The unique name of the agent to authenticate.orgPositionID - The ID of the organisational position for which the
user is to be logged on.password - The password of the user corresponding to the designated
name.userSessionID - The ID of the user session which is provided by
various (client) frameworks. For instance HTTP-frameworks use this
HTTP-Session-ID to identify each user uniquely.AuthenticationException - If the password and/or the username are
incorrect, an AuthenticationException will be
thrown.DataSourceException - If an an unrecoverable error occurs while
accessing the data source containing the username and the
password, a DataSourceException will be thrown.ClientSessionFactory authenticate(java.lang.String agentName, long orgPositionID, java.lang.String method, byte[] authenticationData, AFCallbackHandler callbackHandler, java.lang.String userSessionID) throws AuthenticationException
QualifedAgent with the designated authentication method providing
the authentication method-specific data. For information on this data refer to
AuthMethod. The designated callback handler allows the used authentication method to
request additional data while authenticating. For how to use this refer to
CallbackHandler and JAAS. The session
tokens created by the returned client session factory will have the designated user session ID.agentName - The unique name of the agent to authenticate. This must not be null nor the
empty string.orgPositionID - The ID of the organisational position of the corresponding
QualifedAgent.method - The authentication method to use for authentication. This must not be null nor
the empty string.authenticationData - The data required by the designated authentication method. Depending
on the authentication method this may be null or empty.callbackHandler - A handler for callbacks allowing the used authentication method to
request further data. This may be null in case no callbacks are required.userSessionID - The ID of the user session which is provided by various (client)
frameworks. For instance HTTP-frameworks use this HTTP-Session-ID to identify each
user uniquely. This must not be null.AuthenticationException - If the designated agent cannot be authenticated by the
designated data with the designated authentication method and the callback handler or
the agent is not allowed to log on at the provided application, an
AuthenticationException will be thrown.ClientSessionFactory[] authenticateCombined(java.lang.String agentName, java.lang.String method, byte[] authenticationData, AFCallbackHandler callbackHandler) throws AuthenticationException
authenticate(String, String, byte[], AFCallbackHandler) and
authenticate(String, long, String, byte[], AFCallbackHandler) or
authenticate(String, long, String, byte[], AFCallbackHandler, String) in one step.
Choosing the organisational position is done via a
OrgPositionChoiceCallback. If there is only one organisational position, this will be chosen
without using the callback. UserSessionIDCallback. However, since using user session IDs is optional, the callback handler
need not handle these callbacks and may even throw an
UnsupportedCallbackException
for them.
The restrictions for valid combinations for the authentication method apply here additionally.
agentName - The unique name of the agent to authenticate. This must not be null nor the
empty string.method - The authentication method to use for authentication. This must not be null nor
the empty string.authenticationData - The data required by the designated authentication method. Depending
on the authentication method this may be null or empty.callbackHandler - A handler for callbacks allowing the used authentication method to
request further data. This may be null in case no callbacks (especially for choosing
the organisational position) are required.AuthenticationException - If the designated agent cannot be authenticated by the
designated data with the designated authentication method and the callback handler or
the agent is not allowed to log on at the provided application, an
AuthenticationException will be thrown.ClientSessionFactory[] authenticateCombined(java.lang.String method, byte[] authenticationData, AFCallbackHandler callbackHandler) throws AuthenticationException
authenticate(String, byte[], AFCallbackHandler) and
authenticate(String, long, String, byte[], AFCallbackHandler) or
authenticate(String, long, String, byte[], AFCallbackHandler, String) in one step.
Choosing the organisational position is done via a
OrgPositionChoiceCallback. If there is only one organisational position, this will be chosen
without using the callback. UserSessionIDCallback. However, since using user session IDs is optional, the callback handler
need not handle these callbacks and may even throw an
UnsupportedCallbackException
for them.
The restrictions for valid combinations for the authentication method apply here additionally.
method - The authentication method to use for authentication. This must not be null.authenticationData - The data required by the designated authentication method. Depending
on the authentication method this may be null or empty.callbackHandler - A handler for callbacks allowing the used authentication method to
request further data. This may be null in case no callbacks (especially for choosing
the organisational position) are required.AuthenticationException - If the designated agent cannot be authenticated by the
designated data with the designated authentication method and the callback handler or
the agent is not allowed to log on at the provided application, an
AuthenticationException will be thrown.void logoff(SessionToken session) throws AuthenticationException
SessionToken. All further requests with similar session tokens
to the API will be declined.session - The session identifying the agent to log off. This must not
be null.AuthenticationException - If logging off fails, for instance due to
an invalid session token, an AuthenticationException
will be thrown.