Class SessionData
- All Implemented Interfaces:
Serializable
The SessionData object records the state of the sign-on process. It is passed to the KeyMaster servlet once the user has successfully signed on to the required level; for example, when they have passed the second stage of a two factor (2FA) authentication procedure.
The object is saved in the servlet session under the key SESSION_DATA_KEY ("caplin.signon").
The Authentication Filter, sitting above the KeyMaster Servlet, uses this data to prevent access to the KeyMaster servlet until the user is signed on to the required level (the required level is specified in the filter parameter allowed.auth.levels - see configuring the authentication filter on the Overview page.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
String constant for single factor authentication (1FA) levelstatic final String
String constant for two factor authentication (2FA) levelstatic final String
String constant for SSO levelstatic final String
String constant specifying 2FA SMS authentication i.e.static final String
String constant specifying 2FA TOKEN authentication i.e.static final String
String constant user authentication i.e.static final String
The key used to save this object in the servlet session datastatic final String
-
Constructor Summary
ConstructorDescriptionConstructor called by Signon servlet to create a signon session data object that will be stored in servlet session under the key SESSION_DATA_KEY ("caplin.signon"). -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all fields in this objectGets the value of an additional field that was set by a call tosetField(String, Object)
.Gets the value of the extra data that is to be added to the KeyMaster credentials token and digitally signed.Gets the map of extra name-value pairs that will be added to the KeyMaster credentials token generated by the KeyMaster servlet.getLevel()
Gets the current authentication level.Gets the current authentication scheme.Gets the value of the authentication scheme that was recorded by the last call tosetSentScheme(String)
.Gets the value of the 2FA token recorded in the last call tosetSentSchemeToken(String)
.Gets the username of the user associated with the current servlet session.void
Sets the name and value of an additional field that needs to be saved between authentication requests or needs to be to be passed to a custom Authentication filter or custom KeyMaster servlet.void
Sets a value that can be used by the KeyMaster servlet to add extra data to the KeyMaster credentials token.void
setKeyMasterMappingData
(Map<String, String> value) Sets a map of extra name-value pairs that will be added to the KeyMaster credentials token generated by the KeyMaster servlet.void
Sets the current authentication level.void
Sets the current authentication scheme.void
setSentScheme
(String value) Sets the value of the authentication scheme that was specified in a /sendtoken request received by the SignOn servlet.void
setSentSchemeToken
(String value) Sets the value of the 2FA token sent to the user for the authentication scheme that was recorded by the last call tosetSentScheme(String)
.void
setUserName
(String value) Sets the username associated with the current servlet session.toString()
-
Field Details
-
SESSION_DATA_KEY
The key used to save this object in the servlet session data- See Also:
-
LEVEL_1FA
String constant for single factor authentication (1FA) level- See Also:
-
LEVEL_2FA
String constant for two factor authentication (2FA) level- See Also:
-
LEVEL_SSO
String constant for SSO level- See Also:
-
SCHEME_USER
String constant user authentication i.e. checking user and password- See Also:
-
SCHEME_SMS
String constant specifying 2FA SMS authentication i.e. checking SMS token- See Also:
-
SCHEME_TOKEN
String constant specifying 2FA TOKEN authentication i.e. checking a hardware generated token- See Also:
-
SIGNON_USERNAME
- See Also:
-
-
Constructor Details
-
SessionData
public SessionData()Constructor called by Signon servlet to create a signon session data object that will be stored in servlet session under the key SESSION_DATA_KEY ("caplin.signon").
-
-
Method Details
-
clear
public void clear()Clears all fields in this object -
getLevel
Gets the current authentication level.
Commonly used values are defined in constants of the form LEVEL_<LEVEL_NAME>.
- Returns:
- the current signon level
-
setLevel
Sets the current authentication level.
Commonly used values are defined in constants of the form LEVEL_<LEVEL_NAME>.
- Parameters:
value
- the new signon level
-
getUserName
Gets the username of the user associated with the current servlet session.- Returns:
- the username
-
setUserName
Sets the username associated with the current servlet session.- Parameters:
value
- the username
-
setField
Sets the name and value of an additional field that needs to be saved between authentication requests or needs to be to be passed to a custom Authentication filter or custom KeyMaster servlet.
- Parameters:
name
- a name for the fieldvalue
- the value of the field
-
getField
Gets the value of an additional field that was set by a call to
setField(String, Object)
.- Parameters:
name
- the name of the field to retrieve- Returns:
- the value of the field, or null if the field is not found.
-
setScheme
Sets the current authentication scheme. Commonly used values are defined in constants of the form SCHEME_<SCHEME_NAME>
- Parameters:
value
- the new scheme value
-
getScheme
Gets the current authentication scheme. Commonly used values are defined in constants of the form SCHEME_<SCHEME_NAME>
- Returns:
- the current scheme value
-
setSentScheme
Sets the value of the authentication scheme that was specified in a /sendtoken request received by the SignOn servlet. This value can be used to check the next received /authenticate request.
- Parameters:
value
- the value of the scheme requested in a sendtoken request
-
getSentScheme
Gets the value of the authentication scheme that was recorded by the last call to
setSentScheme(String)
.- Returns:
- the sent scheme value
-
setSentSchemeToken
Sets the value of the 2FA token sent to the user for the authentication scheme that was recorded by the last call to
setSentScheme(String)
. (The token was sent in response to a /sendtoken request - see Request handling on the Overview page.)- Parameters:
value
- the token sent to the user
-
getSentSchemeToken
Gets the value of the 2FA token recorded in the last call to
setSentSchemeToken(String)
. This is used to check the value submitted on the next /authenticate request.- Returns:
- the value of the 2FA token
-
setKeyMasterExtraDataToSign
Sets a value that can be used by the KeyMaster servlet to add extra data to the KeyMaster credentials token.
- Parameters:
value
- the extra data to set
-
getKeyMasterExtraDataToSign
Gets the value of the extra data that is to be added to the KeyMaster credentials token and digitally signed.
- Returns:
- the value of the keymaster extra data to sign field or null if there isn't any.
-
setKeyMasterMappingData
Sets a map of extra name-value pairs that will be added to the KeyMaster credentials token generated by the KeyMaster servlet. See KeyMasterMappingData in Configuring the KeyMaster servlet on the Overview page
- Parameters:
value
- the map of data to add to the KeyMaster token.
-
getKeyMasterMappingData
Gets the map of extra name-value pairs that will be added to the KeyMaster credentials token generated by the KeyMaster servlet. See KeyMasterMappingData in Configuring the KeyMaster servlet on the Overview page
- Returns:
- the value of the KeyMaster mapping data
-
toString
-