The com.sun.identity.authentication.spi.AMPostAuthProcessInterface interface can be implemented for post processing tasks on authentication success, failure and logout using the methods onLoginSuccess(), onLoginFailure(), and onLogout(), respectively. The Authentication Post Processing Classes are defined in the Core Authentication Service and configurable at several levels such as at the realm or role levels. Post processing tasks might include:
Adding attributes to a user’s session token after successful authentication.
Sending notification to an administrator after failed authentication.
General clean up such as clearing cookies after logout, or logging out of other system components.