Package org.forgerock.openam.saml2.audit
Class SAML2Auditor
- java.lang.Object
-
- org.forgerock.openam.saml2.audit.SAML2Auditor
-
- All Implemented Interfaces:
SAML2EventLogger
public class SAML2Auditor extends Object implements SAML2EventLogger
Responsible for publishing audit access events for individual SAML2 requests. A SAML2Auditor is not thread safe and a new SAML2Auditor should be used for each request.
-
-
Constructor Summary
Constructors Constructor Description SAML2Auditor(AuditEventPublisher auditEventPublisher, AuditEventFactory auditEventFactory, jakarta.servlet.http.HttpServletRequest request)
Constructor for SAML2Auditor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
auditAccessAttempt()
Publishes an audit event with details of the attempted SAML2 operation, if the 'access' topic is audited.void
auditAccessFailure(String errorCode, String message)
Publishes an event with details of the failed CREST operation, if the 'access' topic is audited.void
auditAccessSuccess()
Publishes an event with details of the successfully completed SAML2 operation, if the 'access' topic is audited.void
auditForwardToLocalUserLogin()
Audits a forward to local user Login Acitonvoid
auditForwardToProxy()
Audits a forward to proxy action.void
setAuthTokenId(Object session)
void
setMethod(String method)
void
setRealm(String realm)
void
setRequestId(String authnRequestId)
/**void
setSessionTrackingId(String trackingId)
void
setSSOTokenId(Object session)
void
setUserId(String userId)
-
-
-
Constructor Detail
-
SAML2Auditor
public SAML2Auditor(AuditEventPublisher auditEventPublisher, AuditEventFactory auditEventFactory, jakarta.servlet.http.HttpServletRequest request)
Constructor for SAML2Auditor- Parameters:
auditEventPublisher
- The AuditEventPublisherauditEventFactory
- The AuditEventFactoryrequest
- The HttpServletReqeust associated with the SAML2 request
-
-
Method Detail
-
auditAccessAttempt
public void auditAccessAttempt()
Description copied from interface:SAML2EventLogger
Publishes an audit event with details of the attempted SAML2 operation, if the 'access' topic is audited.- Specified by:
auditAccessAttempt
in interfaceSAML2EventLogger
-
auditAccessSuccess
public void auditAccessSuccess()
Description copied from interface:SAML2EventLogger
Publishes an event with details of the successfully completed SAML2 operation, if the 'access' topic is audited. Any exception that occurs while trying to publish the audit event will be captured in the debug logs but otherwise ignored.- Specified by:
auditAccessSuccess
in interfaceSAML2EventLogger
-
auditAccessFailure
public void auditAccessFailure(String errorCode, String message)
Description copied from interface:SAML2EventLogger
Publishes an event with details of the failed CREST operation, if the 'access' topic is audited. Any exception that occurs while trying to publish the audit event will be captured in the debug logs but otherwise ignored.- Specified by:
auditAccessFailure
in interfaceSAML2EventLogger
- Parameters:
errorCode
- A unique code that identifies the error condition.message
- A human-readable description of the error that occurred.
-
setSessionTrackingId
public void setSessionTrackingId(String trackingId)
- Specified by:
setSessionTrackingId
in interfaceSAML2EventLogger
- Parameters:
trackingId
- Unique alias of session.
-
setUserId
public void setUserId(String userId)
- Specified by:
setUserId
in interfaceSAML2EventLogger
- Parameters:
userId
- Identifies Subject of authentication.
-
setRealm
public void setRealm(String realm)
- Specified by:
setRealm
in interfaceSAML2EventLogger
- Parameters:
realm
- The realm for which the event is being logged.
-
setMethod
public void setMethod(String method)
- Specified by:
setMethod
in interfaceSAML2EventLogger
- Parameters:
method
- Identifies the operation invoked.
-
auditForwardToProxy
public void auditForwardToProxy()
Description copied from interface:SAML2EventLogger
Audits a forward to proxy action.- Specified by:
auditForwardToProxy
in interfaceSAML2EventLogger
-
auditForwardToLocalUserLogin
public void auditForwardToLocalUserLogin()
Description copied from interface:SAML2EventLogger
Audits a forward to local user Login Aciton- Specified by:
auditForwardToLocalUserLogin
in interfaceSAML2EventLogger
-
setRequestId
public void setRequestId(String authnRequestId)
Description copied from interface:SAML2EventLogger
/**- Specified by:
setRequestId
in interfaceSAML2EventLogger
- Parameters:
authnRequestId
- the request id to log for this saml2 auth request
-
setSSOTokenId
public void setSSOTokenId(Object session)
- Specified by:
setSSOTokenId
in interfaceSAML2EventLogger
- Parameters:
session
- sets the sso token id
-
setAuthTokenId
public void setAuthTokenId(Object session)
- Specified by:
setAuthTokenId
in interfaceSAML2EventLogger
- Parameters:
session
- the auth token id for the preceding authentication request
-
-