This documentation is for WSO2 Identity Server 5.1.0 . View documentation for the latest release.
Skip to end of metadata
Go to start of metadata

WSO2 Carbon User Stores provide the ability to customize user store operations by registering an event listener for these operations. The listeners are executed at a fixed point in the user store operation, and the users are free to create a listener which implements their desired logic to be executed at these fixed points. 

The following diagram demonstrates a typical flow of execution of the user store operation, along with the listener's methods. The 'operation' method (here, representative of any user store operation) first calls the listener.doPreOperation which is implemented in the listener, then calls the doOperation, which is implemented in the subclass extending the org.wso2.carbon.user.core.common.AbstractUserStoreManager (the abstract class which implements the UserStoreManager interface). After this, the listener.doPostOperation method is called. However, this flow will change depending on the implementation (for instance in the carbon authorization flow, there is only one listener method that is being called ). 

In WSO2 Carbon products that use the standard user manager kernel, we have multiple interfaces with which we can implement User Store Listeners. 

Listener InterfaceOperation TypeCaller ClassRemarks
org.wso2.carbon.user.core.listener.AuthorizationManagerListenerdoPreOperationorg.wso2.carbon.user.core.authorization.JDBCAuthorizationManagerOnly one listener method which gets called before each implemented operation logic
org.wso2.carbon.user.core.listener.ClaimManagerListenerdoPreOperationorg.wso2.carbon.user.core.claim.DefaultClaimManagerOnly one listener method which gets called before each implemented operation logic
org.wso2.carbon.user.core.listener.UserOperationEventListenerdoPreOperation and doPostOperationorg.wso2.carbon.user.core.common.AbstractUserStoreManagerpre and post operations that get called before and after (respectively) implemented operation logic
org.wso2.carbon.user.core.listener.UserStoreManagerConfigurationListenerdoPreOperationorg.wso2.carbon.user.core.common.AbstractUserStoreManagerOne listener method which is executed before the implemented logic
org.wso2.carbon.user.core.listener.UserStoreManagerListenerdoPreOperationorg.wso2.carbon.user.core.common.AbstractUserStoreManagerOne listener method which is executed before the implemented logic

It is recommended to extend the existing abstract implementation of these interfaces rather than implementing from scratch. For example, org.wso2.carbon.user.core.listener.UserOperationEventListener is implemented in the org.wso2.carbon.user.core.common.AbstractUserOperationEventListener abstract class. 

  • No labels