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
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.
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
Step 2: Click on the ‘
Service Providers menu from the sidebar.
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:
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.