SAP Open Connectors

Callback URLs for OAuth Proxies

 The OAuth Proxy feature provided by SAP Open Connectors offers the possibility to connect multiple environments using only one callback URL (the one provided by SAP Open Connectors). In some cases, the application can support only one callback URL, thus limiting the developer’s possibilities. 

This feature can enable multiple domain connections possibilities. As each application domain can differ, and to ensure a successful connection through the provided callback URL, the application field should contain only valid regex regular expressions. 

Regex regular expressions represents a sequence of characters that define a search pattern. They are a way to describe patterns in a string data and they form a small separate language (it is part of JavaScript but also from many other programming language). When used in JavaScript these regular expressions are also objects. They can provide compilation of the regular expression when the script is loaded. For example, if a company owns the domain named《 *justATest.com 》, this one has to be adjusted to the regex regular expressions into this way: 《 .*\.justATest\.com 》.

If the chosen application URL does not fulfill the regex regular expression rules no connection can be established to the desired application. The error can be displayed in two different ways, depending the connection method:

  1. If you are connected in your application UI and want to see from a user’s perspective how the connection is performed, instead of being redirected to the application connection page where you can type in your credentials, a blank page will be displayed in your browser with the message “This site can’t be reached… ERR_TIMED_OUT”;

  1. If you’re trying to connect via Postman or any other tool that supports every stage of the API Lifecycle, the following error message will be displayed “Failed to retrieve OAuth authorize url”.


Here is an example of an invalid regular expression case: 

  1. Create an OAuth Proxy and add an invalid regular expression: 

                                               


  1. Check the application connection through Postman:

               


  1. The above error appears due to an invalid regex expression used in the callback URL provided within the OAuth Proxy Application URL: 


                         


  1. The previous error from steps 2 and 3 can be avoided if the domain URL is adjusted to the regex regular expressions using this 《 .*\.justATest\.com 》instead of this 《 *justATest.com 》.