Class AbstractAuthenticationEventAuditor
- java.lang.Object
-
- com.sun.identity.authentication.audit.AbstractAuthenticationEventAuditor
-
- Direct Known Subclasses:
AuthenticationModuleEventAuditor,AuthenticationProcessEventAuditor
public abstract class AbstractAuthenticationEventAuditor extends Object
Abstract auditor for constructing and logging authentication events.- Since:
- 13.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditEventFactoryeventFactoryprotected AuditEventPublishereventPublisher
-
Constructor Summary
Constructors Constructor Description AbstractAuthenticationEventAuditor(AuditEventPublisher eventPublisher, AuditEventFactory eventFactory)Constructor forAbstractAuthenticationEventAuditor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetFailedPrincipal(LoginState loginState)Get the failed username from the of the event.protected StringgetRealmFromState(LoginState loginState)Get the realm from the login state of the event.protected StringgetRealmFromToken(SSOToken token)Get the realm from the of the event.protected Set<String>getTrackingIds(LoginState loginState)Get the tracking ID from the login state of the event.protected StringgetUserId(String principalName, String realm)Get the universal user ID.
-
-
-
Field Detail
-
eventPublisher
protected final AuditEventPublisher eventPublisher
-
eventFactory
protected final AuditEventFactory eventFactory
-
-
Constructor Detail
-
AbstractAuthenticationEventAuditor
public AbstractAuthenticationEventAuditor(AuditEventPublisher eventPublisher, AuditEventFactory eventFactory)
Constructor forAbstractAuthenticationEventAuditor.- Parameters:
eventPublisher- The publisher responsible for logging the events.eventFactory- The factory that can be used to create the events.
-
-
Method Detail
-
getUserId
protected String getUserId(String principalName, String realm)
Get the universal user ID.- Parameters:
principalName- The principal name.realm- The realm.- Returns:
- The universal user ID or an empty string if it could not be found.
-
getTrackingIds
protected Set<String> getTrackingIds(LoginState loginState)
Get the tracking ID from the login state of the event.- Parameters:
loginState- The login state of the event.- Returns:
- The tracking ID or an empty string if it could not be found.
-
getRealmFromState
protected String getRealmFromState(LoginState loginState)
Get the realm from the login state of the event.- Parameters:
loginState- The login state of the event.- Returns:
- The realm or null if it could not be found.
-
getRealmFromToken
protected String getRealmFromToken(SSOToken token)
Get the realm from the of the event.- Parameters:
token- The of the event.- Returns:
- The realm or null if it could not be found.
-
getFailedPrincipal
protected String getFailedPrincipal(LoginState loginState)
Get the failed username from the of the event.- Parameters:
loginState- The login state of the event.- Returns:
- The username or null if it could not be found.
-
-