Class AuditTrail
java.lang.Object
org.forgerock.caf.authentication.framework.AuditTrail
Responsible for tracking the auditing of an authentication attempt including auditing each of the modules that are executed and the overall result of the authentication.
The audit record will include a unique request id, the principal (if authentication was successful) and a session id (if a session was created).
- Since:
- 1.5.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
MessageInfo map key for setting the reason for the module failure.static final String
MessageInfo map key for setting additional audit information from a module.static final String
MessageInfo map key for setting the principal that the auth module has identified that will be set in the audit log entry.static final String
MessageInfo map key for setting the session id for the authentication request.static final String
MessageInfo map key for retrieving the audit trail instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Audits a module as having completed as a failure.void
auditSuccess
(String moduleId, Map<String, Object> info) Audits a module as having completed successfully.Gets the list of failure reasons from each of the module entries.void
setSessionId
(String sessionId) Sets the session id on the audit record, if a session has been created.toString()
-
Field Details
-
AUDIT_TRAIL_KEY
MessageInfo map key for retrieving the audit trail instance.- See Also:
-
AUDIT_INFO_KEY
MessageInfo map key for setting additional audit information from a module.- See Also:
-
AUDIT_PRINCIPAL_KEY
MessageInfo map key for setting the principal that the auth module has identified that will be set in the audit log entry.- See Also:
-
AUDIT_SESSION_ID_KEY
MessageInfo map key for setting the session id for the authentication request.- See Also:
-
AUDIT_FAILURE_REASON_KEY
MessageInfo map key for setting the reason for the module failure.- See Also:
-
-
Method Details
-
auditSuccess
Audits a module as having completed successfully.- Parameters:
moduleId
- The id of the module.info
- The module audit info map.
-
auditFailure
Audits a module as having completed as a failure.- Parameters:
moduleId
- The id of the module.reason
- The reason the module is reporting a failure.info
- The module audit info map.
-
setSessionId
Sets the session id on the audit record, if a session has been created. Will not set the session id on the audit record if it isnull
or an emptyString
.- Parameters:
sessionId
- The session id.
-
getFailureReasons
Gets the list of failure reasons from each of the module entries.- Returns:
- A
List
of failure reasons asMap
s ofString
toObject
s.
-
toString
-