Use RegEx In Callback URL On API Manager Store

Isuru Uyanage
2 min readDec 13, 2018

Now we can use multiple callback URLs as a regex pattern using WSO2 API Manager.

regexp=(http://test1.com|http://test2.com)

Use case

  1. Setup Playground application and deploy it in Tomcat.
  2. Start WSO2 API Manager and login to API Store.
  3. Create a new application.
  4. For the Callback URL provide as below.
regex=(http://localhost:8080/playground2/oauth2client| http://wso2is.local:8080/playground2/oauth2client)
Callback URL — regex

5. Navigate to Playground application

http://localhost:8080/playground2/oauth2client

6. Provide the following details.

Client Id: Your consumer key in the application
Callback URL: http://wso2is.local:8080/playground2
Authorize Endpoint: https://localhost:9443/oauth2/authorize

You will get the authorization code as below after set of steps.

For the callback URL you can either use http://localhost:8080/playground2/oauth2client or http://wso2is.local:8080/playground2/oauth2client. Because you registered both the URLs in step 4.

But assume you remove http://localhost:8080/playground2/oauth2client from the callback URL and perform step 5, then you will not be able to log in since it is now not a registered URL.

You will get the following error.

--

--