Interface AuthMethod
-
public interface AuthMethodThis interfaces declares and describes various authentication methods that may be supported by implementations ofAuthenticationandSecurityManager. An implementation may choose not to support an authentication method and throw anAuthenticationExceptionwith an appropriate message when called with this authentication method. Usually these authentication methods are used for the local security manager which in turn may provide the result of the local authentication to the global security manager before really authenticating. The local security manager may change the authentication method, for instance, using JAAS locally and sending the correspondingSubjectto the global security manager without the authentication data used locally.There are several method parameters for authentication but not all work with every authentication method and some are optional. This interface explains the possible parameter combinations and their meaning. First there may or may not be a unique identifier of type
String, for instance the username. Second there must always be the name of the authentication method (String), usually one that is declared in this interface. Third the authentication data (byte[]) of the authentication method is always present, but for some authentication methods, this may benull. And last aCallbackHandlermay be provided that allows the implementation of an authentication method to request additional data since the provided one is insufficient. For instance when no username is provided but one is needed and an appropriate callback handler is required, the username may be requested interactively. Another example for callbacks is the need to change the password since the provided one has expired.
The different combinations of some sort of user ID (String), authentication data (byte[]) and callback handler (AFCallbackHandler) and the meaning of the respective parameter value are explained for each supported authentication method below. Additionally, the known callbacks are described but this may not be complete since the used callbacks may depend on the implementation.Each authentication method may have specific configuration values that are read from the configuration of the
SecurityManager. These are also defined and described here.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONF_NET_LOCAL_ADDRESSConfiguration key for network-based authentication (NET_IP_ADDRESSandNET_MAC_ADDRESS).static StringCONF_USE_JAASConfiguration key for whether to use JAAS.static StringFORWARD_SUBJECTThe authentication data is aSubjectbut it is not provided to the local JAAS but just forwarded to the global security manager usingGlobalAuthMethod.JAAS_SUBJECTon server-side.static StringIMPLICIT_NETWORKThe communication provides the network-related data which is interpreted by the global security manager.static StringJAASA JAAS-based authentication without any further information.static StringJAAS_SUBJECTA JAAS-based authentication with aSubjectto provide to the local JAAS.static StringJAAS_UTF8_PASSWORDThe usual password based authentication likeUTF8_PASSWORDbut this time requiring JAAS.static StringNET_IP_ADDRESSThe local security manager provides its own configured IP-address (seeCONF_NET_LOCAL_ADDRESS), signs it and callsGlobalAuthMethod.TRUSTED_NET_IP_SIGNEDat the global security manager.static StringNET_MAC_ADDRESSThe local security manager provides its own configured MAC-address (seeCONF_NET_LOCAL_ADDRESS), signs it and callsGlobalAuthMethod.TRUSTED_NET_MAC_SIGNEDat the global security manager.static StringOAUTH2_TOKENThe user is identified via an OAuth2 token.static StringSERIALISED_CLIENT_SESSION_FACTORYThe user is identified via the own client session factory.static StringSHARED_UTF8_KEYThe clients provide a shared key (a string provided as UTF-8).static StringUTF8_PASSWORDThe usual password based authentication.
-
-
-
Field Detail
-
UTF8_PASSWORD
static final String UTF8_PASSWORD
The usual password based authentication. The password is plain being no hash and not encoded (except UTF-8).
If JAAS is used locally (CONF_USE_JAAS, theString(if present) will be provided to aNameCallbackand the password (byte[]) will be provided to aPasswordCallback.
If no JAAS is used locally, the organisational model will be inspected.Combinations of parameters and their semantic for UTF-8_PASSWORD String,byte[], nullStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]The plain password as UTF-8-encoded byte representation of the password string. String,byte[],AFCallbackHandlerStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]The plain password as UTF-8-encoded byte representation of the password string. AFCallbackHandlerThis may use a NameCallbackif the username is not found andPasswordCallbackif the password is wrong. When using JAAS, there may be additional callbacks depending on the underlying JAAS-LoginModule.byte[], nullAuthenticationExceptionalways. The provided data is insufficient and no data can be requested via aCallback.byte[],AFCallbackHandlerbyte[]The plain password as UTF-8-encoded byte representation of the password string. AFCallbackHandlerThis will use a NameCallbackfor the username and may usePasswordCallbackif the password is wrong. When using JAAS, there may be additional callbacks depending on the underlying JAAS-LoginModule.- See Also:
- Constant Field Values
-
JAAS
static final String JAAS
A JAAS-based authentication without any further information. This depends on the JAAS-configuration of the local JVM and therefore the usage of a callback handler is strongly encouraged.
This method requires JAAS to be configured (CONF_USE_JAAS).Combinations of parameters and their semantic for JAAS String,byte[], nullStringIgnored. byte[]Ignored. String,byte[],AFCallbackHandlerStringIgnored. byte[]Ignored. AFCallbackHandlerThis may use a NameCallbackif the username is not found andPasswordCallbackif the password is wrong. There may be additional callbacks depending on the underlying JAAS-LoginModule.byte[], nullbyte[]Ignored. byte[],AFCallbackHandlerbyte[]Ignored. AFCallbackHandlerThis will use a NameCallbackfor the username and may usePasswordCallbackif the password is wrong. There may be additional callbacks depending on the underlying JAAS-LoginModule.- See Also:
- Constant Field Values
-
JAAS_UTF8_PASSWORD
static final String JAAS_UTF8_PASSWORD
The usual password based authentication likeUTF8_PASSWORDbut this time requiring JAAS. Therefore this method requires JAAS to be configured (CONF_USE_JAAS). The password is plain being no hash and not encoded (except UTF-8).Combinations of parameters and their semantic for JAAS_UTF8_PASSWORD String,byte[], nullStringThe identifier of the entity, usually the username or a numerical user ID (as String). This will be provided to aNameCallback.byte[]The plain password as UTF-8-encoded byte representation of the password string. This will be provided to a PasswordCallback.String,byte[],AFCallbackHandlerStringThe identifier of the entity, usually the username or a numerical user ID (as String). This will be provided to aNameCallback.byte[]The plain password as UTF-8-encoded byte representation of the password string. This will be provided to a PasswordCallback.AFCallbackHandlerThe handler to which all callbacks except NameCallbackandPasswordCallbackwill be forwarded to. These callbacks depend on the underlying JAAS-LoginModule.byte[], nullbyte[]The plain password as UTF-8-encoded byte representation of the password string. This will be provided to a PasswordCallback.byte[],AFCallbackHandlerbyte[]The plain password as UTF-8-encoded byte representation of the password string. AFCallbackHandlerThe handler to which all callbacks except PasswordCallbackwill be forwarded to. These callbacks depend on the underlying JAAS-LoginModule.
-
JAAS_SUBJECT
static final String JAAS_SUBJECT
A JAAS-based authentication with aSubjectto provide to the local JAAS.
This method requires JAAS to be configured (CONF_USE_JAAS).Note that the principals of the subject or rather the corresponding classes need to be found by the global security manager.
Combinations of parameters and their semantic for JAAS_SUBJECT String,byte[], nullStringIgnored. byte[]A serialised Subjectthat is provided to the JAAS-LoginContext.String,byte[],AFCallbackHandlerStringIgnored. byte[]A serialised Subjectthat is provided to the JAAS-LoginContext.AFCallbackHandlerThe callbacks depend on the designated subject and the underlying JAAS- LoginModule.byte[], nullbyte[]A serialised Subjectthat is provided to the JAAS-LoginContext.byte[],AFCallbackHandlerbyte[]A serialised Subjectthat is provided to the JAAS-LoginContext.AFCallbackHandlerThe callbacks depend on the designated subject and the underlying JAAS- LoginModule.
-
CONF_USE_JAAS
static final String CONF_USE_JAAS
Configuration key for whether to use JAAS. This has to be set for JAAS-based authentication methods (JAAS,JAAS_UTF8_PASSWORDandJAAS_SUBJECT). If this is setUTF8_PASSWORDwill be treated likeJAAS_UTF8_PASSWORD.- See Also:
- Constant Field Values
-
FORWARD_SUBJECT
static final String FORWARD_SUBJECT
The authentication data is aSubjectbut it is not provided to the local JAAS but just forwarded to the global security manager usingGlobalAuthMethod.JAAS_SUBJECTon server-side.Combinations of parameters and their semantic for FORWARD_SUBJECT String,byte[], nullStringJust forwarded to the global security manager where it should be ignored. byte[]A serialised Subjectthat is provided to the global security manager.String,byte[],AFCallbackHandlerStringJust forwarded to the global security manager where it should be ignored. byte[]A serialised Subjectthat is provided to the global security manager.AFCallbackHandlerThe callbacks depend on the designated subject and the JAAS- LoginModuleon server-side.byte[], nullbyte[]A serialised Subjectthat is provided to the global security manager.byte[],AFCallbackHandlerbyte[]A serialised Subjectthat is provided to the global security manager.AFCallbackHandlerThe callbacks depend on the designated subject and the JAAS- LoginModuleon server-side.- See Also:
- Constant Field Values
-
CONF_NET_LOCAL_ADDRESS
static final String CONF_NET_LOCAL_ADDRESS
Configuration key for network-based authentication (NET_IP_ADDRESSandNET_MAC_ADDRESS).The client requesting network-based authentication may have several network interfaces. This configuration provides the name (or the textual representation) as
Stringof the network interface to use.
Obviously one should not use "localhost". ;-)- See Also:
- Constant Field Values
-
NET_IP_ADDRESS
static final String NET_IP_ADDRESS
The local security manager provides its own configured IP-address (seeCONF_NET_LOCAL_ADDRESS), signs it and callsGlobalAuthMethod.TRUSTED_NET_IP_SIGNEDat the global security manager. Untrusted security manager should omit the signature and useGlobalAuthMethod.TRUSTED_NET_IP_UNSIGNED.Combinations of parameters and their semantic for NET_IP_ADDRESS String,byte[], nullStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]Ignored. String,byte[],AFCallbackHandlerStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]Ignored. AFCallbackHandlerJust forwarded to the global security manager. byte[], nullAuthenticationExceptionalways. The provided data is insufficient and no data can be requested via aCallback.byte[],AFCallbackHandlerbyte[]Ignored. AFCallbackHandlerJust forwarded to the global security manager where it will probably request the name via NameCallback.- See Also:
- Constant Field Values
-
NET_MAC_ADDRESS
static final String NET_MAC_ADDRESS
The local security manager provides its own configured MAC-address (seeCONF_NET_LOCAL_ADDRESS), signs it and callsGlobalAuthMethod.TRUSTED_NET_MAC_SIGNEDat the global security manager.
Note that for determining the MAC-address.Combinations of parameters and their semantic for NET_MAC_ADDRESS String,byte[], nullStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]Ignored. String,byte[],AFCallbackHandlerStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]Ignored. AFCallbackHandlerJust forwarded to the global security manager. byte[], nullAuthenticationExceptionalways. The provided data is insufficient and no data can be requested via aCallback.byte[],AFCallbackHandlerbyte[]Ignored. AFCallbackHandlerJust forwarded to the global security manager where it will probably request the name via NameCallback.- See Also:
- Constant Field Values
-
IMPLICIT_NETWORK
static final String IMPLICIT_NETWORK
The communication provides the network-related data which is interpreted by the global security manager. The local security manager just forwards the call, however, no parameters are needed, a callback handler may be useful.Combinations of parameters and their semantic for IMPLICIT_NETWORK String,byte[], nullStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]Just forwarded to the global security manager where it should be ignored. String,byte[],AFCallbackHandlerStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]Just forwarded to the global security manager where it should be ignored. AFCallbackHandlerJust forwarded to the global security manager. byte[], nullAuthenticationExceptionalways. The provided data is insufficient and no data can be requested via aCallback.byte[],AFCallbackHandlerbyte[]Just forwarded to the global security manager where it should be ignored. AFCallbackHandlerJust forwarded to the global security manager where it will probably request the name via NameCallback.- See Also:
- Constant Field Values
-
SHARED_UTF8_KEY
static final String SHARED_UTF8_KEY
The clients provide a shared key (a string provided as UTF-8). If the server has this key in a list of accepted keys, the authentication will be accepted. The local security manager just forwards the call.Combinations of parameters and their semantic for SHARED_UTF8_KEY String,byte[], nullStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]The plain shared key as UTF-8-encoded byte representation of the corresponding string. String,byte[],AFCallbackHandlerStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]The plain shared key as UTF-8-encoded byte representation of the corresponding string. AFCallbackHandlerThis may use a NameCallbackif the username is not found.byte[], nullAuthenticationExceptionalways. The provided data is insufficient and no data can be requested via aCallback.byte[],AFCallbackHandlerbyte[]The plain shared key as UTF-8-encoded byte representation of the corresponding string. AFCallbackHandlerThis will use a NameCallbackfor the username.- See Also:
- Constant Field Values
-
OAUTH2_TOKEN
static final String OAUTH2_TOKEN
The user is identified via an OAuth2 token. If the configured OOauth server accepts the token for the designated user name, the authentication will be accepted. The local security manager just forwards the call.Combinations of parameters and their semantic for OAUTH2_TOKEN String,byte[], nullStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]The UTF-8-encoded byte representation of the OAuth2 token. String,byte[],AFCallbackHandlerStringThe identifier of the entity, usually the username or a numerical user ID (as String).byte[]The UTF-8-encoded byte representation of the OAuth2 token. AFCallbackHandlerThis may use a NameCallbackif the username is not found.byte[], nullAuthenticationExceptionalways. The provided data is insufficient and no data can be requested via aCallback.byte[],AFCallbackHandlerbyte[]The UTF-8-encoded byte representation of the OAuth2 token. AFCallbackHandlerThis will use a NameCallbackfor the username.- See Also:
- Constant Field Values
-
SERIALISED_CLIENT_SESSION_FACTORY
static final String SERIALISED_CLIENT_SESSION_FACTORY
The user is identified via the own client session factory. This is simply serialised to a byte array. If the designated client session factory is valid, authentication will succeed and a new client session factory will be returned. This will not change the user session ID, the app name will be ignored.Combinations of parameters and their semantic for SERIALISED_CLIENT_SESSION_FACTORY String,byte[], nullStringJust forwarded to the global security manager where it should be ignored. byte[]The old client session factory serialised to a byte array. String,byte[],AFCallbackHandlerStringJust forwarded to the global security manager where it should be ignored. byte[]The old client session factory serialised to a byte array. AFCallbackHandlerIgnored. byte[], nullbyte[]The old client session factory serialised to a byte array. byte[],AFCallbackHandlerbyte[]The old client session factory serialised to a byte array. AFCallbackHandlerIgnored. - See Also:
- Constant Field Values
-
-