In continuation to my article on WSO2 installation and configuration, here’s another issue that popped up after changing the hostname in the repository/conf/deployment.toml
file. The error “Registered callback does not match with the provided URL” occurs while accessing the login page of the publisher and developer portal. If you are getting this error and needed a solution, then here’s how you can fix it.
Assume that you had changed the hostname of the API manager from localhost
to apim.tg.com
and started the APIM server, then your attempt to login to API publisher and devportal using below URLs would result in ‘Registered callback does not match with the provided URL’ error.
https://localhost:9443/publisher https://localhost:9443/devportal
And you would probably see the error as shown in the below screenshot.
How to fix the “Registered callback does not match with the provided URL” error?
The error is due to the mismatch of the access URL and callback URL configured for the API Publisher and the developer portal service providers.
So after changing the hostname, you need to change the access and callback URLs as shown below:
Step 1: Log in to the Carbon interface
https://<hostname>:9443/carbon
Step 2: Click on the ‘List
‘ under Service Providers
menu from the sidebar.
Step 3: Click the ‘Edit
‘ menu in the ‘apim_publisher
‘ service provider.
Step 4: Go to ‘Inbound Authentication Configuration > OAuth/OpenID Connect Configuration‘ and click on the Edit
link in OAuth Client Key configuration (located under Actions column)
Step 5: Lookout for the Callback Url regex value under the Application Settings.
Step 6: The regex value would look similar to the one shown below:
regexp=(https://localhost:9443/publisher/services/auth/callback/login|https://localhost:9443/publisher/services/auth/callback/logout)
All you need to do is, change the ‘localhost’ to the correct hostname and click on the ‘Update‘ button to save the access and callback URLs.
What’s next? Repeat the process for the ‘apim_devportal
‘ service provider (refer to step 3) as well and you are done.
Do let me know if this solution worked for you.
For my configuration : ubuntu 20.04 – wso2am-4.1.0 : at the top !