wso2wso2-identity-server

How to modify Registering user flow


I want to modify my register form flow, i need that the sumbitted data validates against an API, i've already made a plugin for validating, i just need to instantiate the service and call its validation function with the provided user data, and if its valid then assign a few values provided by the API to the users claims.

The big deal is, i don't know where to implement this, I'm actually doing it by modifying the sel-registration-process.jsp in accountrevrryendpoint webapp, but I don't if this is the most recommended way of doing it, or if it'd be better by extending som class provided by wso2.

If you have any feedback please share it, i'll be glad!


Solution

  • For this purpose you can create a new custom user operation listener by extending the AbstractUserOperationEventListener class [1]. Inside the doPreAddUser method you can call the external API and do the validation.

    [1] https://github.com/wso2/carbon-kernel/blob/a286224351c7d2ab0875a91fe51eaf3b61a312d2/core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/common/AbstractUserOperationEventListener.java#L57