WSO2 API Manager 4.0 | User Registration Multi-Step Approval Workflow

Sampath Rajapakse
5 min readJun 2, 2021

--

In this posts we are trying to implement a use case where an API Consumer user tries to register/sign up to the developer console and the user registration requests needs to be approved from two administrative persons before user can login to the developer console.

Here, we are going to use latest WSO2 API Manager 4.0 and WSO2 Business Process 6.5 servers.

First let’s look at the demo flow of the events after configuration so that you will first get an idea regarding the flow which we are going to achieve. We will come to the configurations at a latter part of the post.

  1. API Consumer user first go to the developer console.
Devportal (Anonymous View)

2. API Consumer click Sign In button and redirected to the login page. Then click the Create Account button and Provide a proper username and Click Proceed to Self Register.

Login Page

3. User is now redirected to Sign Up Form, where user needs to fill the relevant necessary user information.

Sign Up Form

4. User check the Privacy Policy and click Register button afterwards.

Sign Up Form

5. Popup message will be displayed with the message saying account awating administrative approval.

Confirmation Pop Up

6. Now if the user tries to login he will get Forbidden Error since his account is still pending approval.

Forbidden Login Error

Now, the administrators needs to approve the user registration request in order for this user to successfully login to the developer console.

SubManager and Manager are two administrative users who are created to perform approval. First, the approval request is assigned to SubManager and once SubManager has approved the Intermediate Request, it will get assigned to Manager for Final Approval. Once Manager also has approved only then user can successfully login.

7. Now, the SubManager user is login in to the Business Process server to approve the intermediate request.

BPMN Explorer Login Page

8. SubManager needs to select the task.

Intermediate Task Approval

9. SubManager approves the intermediate request.

Approve Intermediate Registration Task

10. Although the initial approval completed if the user tries to login still user won’t be able to login to developer console.

11. Now, Manager logs into the BPMN Explorer to give Final Approval.

Manager Login
Manager Select Task
Give Final Approval

12. Now, the registered user can successfully login to the developer console.

User Login
Successful Login

Now let’s see what needs to be done to configure above flow.

First we will configure Business Process Server.

  1. First you need to create a BPMN activity process using WSO2 Integration Studio. Here i have used Integration Studio 7.2 and you can open the sample project provided here[1].
Integration Studio Project Activity View

2. Go to the Package Explorer View and right click on the project and click create deployment artifacts.

Create Deployment Artifacts

3. This will generate the bar file required for the BPMN Server. Therefore, if you need to re-configure anything in the flow, you can edit the flow and then re generate the deployment artifact.

Deployment Artifact

4. Start the Business Process Server and login to the carbon console.

BPS Carbon Console Login Page

5. Deploy the BPMN process(.bar) file previously generated.

Choose the bar file and upload
Deployed BPMN Process

6. (Optional) View the deployed process diagram.

deployed process

7. Create Role: ManagerRole

Created Role

8. Create Users: SubManager and Manager

Created Users

This finishes the configurations done at BPS side. So next let’s look at the configurations done at API Manager side.

  1. Add the signup-workflow-executor-1.0-SNAPSHOT.jar[1] to the <APIM_HOME>/repository/components/lib directory.

2. Uncomment and update the workflow configurations in the <APIM_HOME>/repository/conf/deployment.toml as follows.

Config

3. Need to add BPS server public certificate to client-trustore.jks.

4. Start the API Manager 4.0

5. Login to the carbon console and edit workflow-extensions.xml as follows.

Workflow-extensions.xml path

Note: make sure to comment out default(simple) UserSignUp Workflow.

This concludes configuration process. So afterwards you should be able to test out the above demo flow.

All the artifacts needed for the above scenario are provided in the below link.

[1] https://drive.google.com/drive/folders/1SmZOcXG5bntBv3nShRHQgs3B_BXWqvnn?usp=sharing

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response