Fixing Registered Callback Issue in an Active-Active Setup of WSO2 APIM
This article shows how to fix the registered callback issue, which occurs when you have an Active-Active setup of WSO2 APIM with a shared database.
Join the DZone community and get the full member experience.
Join For FreeThis article shows how we can fix the registered callback issue which occurs when you have an Active-Active setup of WSO2 APIM with a shared database.
Use Case
We have 2 nodes or machines “hostA” and “hostB” where WSO2 APIM 3.2.0 is set up in an Active-Active mode. Both of the nodes share the same “apim” and “shared” databases created in Oracle.
Issue
After starting the servers on the respective nodes, when we try to open Publisher or Devportal of one of the nodes, it works fine. For the other node, it will give the registered callback error as shown below.
The reason for this issue is, as databases are shared between both the nodes, the callback URL for publisher and devportal in the management console for both the nodes point to the same host (i.e., hostA). Hence, the applications open for one host and the other gives the callback error.
Fix
To resolve this issue, we need to add both the hosts in the regex of the callback URL for publisher and devportal in the management consoles of both the nodes as given in the steps below.
- Login to the management console of both nodes.
- Click on Service Providers List.
- Edit apim_publisher and apim_devportal.
- Expand Inbound Authentication Configuration.
- Expand OAuth/OpenID Connect Configuration.
- Click on Edit under Actions column.
- Under Application Settings, you will find the Callback URL will be as below.
regexp = (https://hostA:9443/publisher/services/auth/callback/login|https://hostA:9443/publisher/services/auth/callback/logout)
8. Change it as given below to fix the issue.
regexp =
(https://hostA:9443/publisher/services/auth/callback/login|https://hostA:9443/publisher/services/auth/callback/logout|https://hostB:9443/publisher/services/auth/callback/login|https://hostB:9443/publisher/services/auth/callback/logout)
Opinions expressed by DZone contributors are their own.
Comments