public class AuditTrail extends Object
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).
Modifier and Type | Field and Description |
---|---|
static String |
AUDIT_FAILURE_REASON_KEY
MessageInfo map key for setting the reason for the module failure.
|
static String |
AUDIT_INFO_KEY
MessageInfo map key for setting additional audit information from a module.
|
static String |
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.
|
static String |
AUDIT_SESSION_ID_KEY
MessageInfo map key for setting the session id for the authentication request.
|
static String |
AUDIT_TRAIL_KEY
MessageInfo map key for retrieving the audit trail instance.
|
Modifier and Type | Method and Description |
---|---|
void |
auditFailure(String moduleId,
Map<String,Object> reason,
Map<String,Object> info)
Audits a module as having completed as a failure.
|
void |
auditSuccess(String moduleId,
Map<String,Object> info)
Audits a module as having completed successfully.
|
List<Map<String,Object>> |
getFailureReasons()
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.
|
String |
toString() |
public static final String AUDIT_TRAIL_KEY
public static final String AUDIT_INFO_KEY
public static final String AUDIT_PRINCIPAL_KEY
public static final String AUDIT_SESSION_ID_KEY
public static final String AUDIT_FAILURE_REASON_KEY
public void auditSuccess(String moduleId, Map<String,Object> info)
moduleId
- The id of the module.info
- The module audit info map.public void auditFailure(String moduleId, Map<String,Object> reason, Map<String,Object> info)
moduleId
- The id of the module.reason
- The reason the module is reporting a failure.info
- The module audit info map.public void setSessionId(String sessionId)
null
or an empty String
.sessionId
- The session id.public List<Map<String,Object>> getFailureReasons()
List
of failure reasons as Map
s of String
to Object
s.Copyright © 2010-2018, ForgeRock All Rights Reserved.