Call the API Gateway from Oracle Visual Builder

The last step in our implementation is to call the API from a HTML5 client: in this example case you are using the Oracle Visual Builder service.

Oracle Cloud Infrastructure API Gateway in the architecture acts as an HTTP front end to incoming requests. The gateway provides a number of useful features for managing APIs.

For this use case, you will use the following features:

  • Mapping of URLs, and REST VERBS, to Oracle Functions using the function's OCID.
  • Enforcing security by only allowing authenticated users the ability to execute functions.
  • Implementing CORS headers.

Within Oracle Visual Builder the service endpoint is configured just like any other OAuth endpoint. Based on the Oracle Identity Cloud Service configuration you set earlier, we will be using the OAuth mechanism called User Assertion oAuth 2.0. Because Oracle Visual Builder is a trusted client of Oracle Identity Cloud Service, it will proxy the logged-in user of Oracle Visual Builder to Oracle Identity Cloud Service, with the clientid and client secret as parameters. Oracle Identity Cloud Service will then return an access token Oracle Visual Builder can use to call the endpoint (our function, via the gateway). This token can then also be used to call an Oracle Fusion Applications Cloud Service REST URL as the authenticated user from Oracle Visual Builder.

If you have enabled CORS in the API Gateway definition and you are using HTTPS, then you can set the token relay flag to true. If this flag is true then Oracle Visual Builder will route all REST traffic directly to the REST service instead of going via the Oracle Visual Builder server: a great optimization technique providing you meet the requirements.

In this configuration, use the scope, client ID, and secret from the Oracle Identity Cloud Service application you created earlier.



Once this is done you can then build an Oracle Visual Builder application as normal and make use of the cloud native functions for the REST calls.