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
FieldsModifier and TypeFieldDescriptionstatic final StringMessageInfo map key for setting the reason for the module failure.static final StringMessageInfo map key for setting additional audit information from a module.static final StringMessageInfo map key for setting the principal that the auth module has identified that will be set in the audit log entry.static final StringMessageInfo map key for setting the session id for the authentication request.static final StringMessageInfo map key for retrieving the audit trail instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidAudits a module as having completed as a failure.voidauditSuccess(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.voidsetSessionId(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 isnullor an emptyString.- Parameters:
sessionId- The session id.
-
getFailureReasons
Gets the list of failure reasons from each of the module entries.- Returns:
- A
Listof failure reasons asMaps ofStringtoObjects.
-
toString
-