Access and Secure Business Objects

Enable role-based security to control access to your business objects through REST endpoints, both for apps in your visual application and external clients. You can configure each business object's security settings to control the user roles that can access the endpoints and the types of operations they can perform.

Secure Business Objects

User roles can be used to secure the data stored in business objects.

By default, the business objects in your application are accessible to all users that can access the application. To secure the data stored in objects, you can use user roles to restrict a user’s access to view, create, update, and delete operations by configuring role-based access for each operation. Users can only perform the operations and interact with the business objects associated with the role that the user has been assigned.

To allow anonymous access to the data in a business object, for each operation you must explicitly set the permissions granted to the Anonymous User authentication role.

To enable role-based security for a business object:

  1. Select the business object you want to secure.
  2. Open the Security tab of the business object.
  3. Click the Role-based security icon to enable security for the object.
    When you enable role-based security for a business object, you see a matrix of the existing user roles and the business operations that can be performed. By default, when you enable security, all existing user roles are permitted to perform all operations. If you create a new user role (see Manage User Roles and Access), permissions to perform operations are disabled for the new role and must be enabled manually.
  4. Select the operations that can be performed by each authentication and user role. You can enable or disable permission for each operation.

    Description of bo-security-enabled.png follows
    Description of the illustration bo-security-enabled.png

    You can further define security at the row level for View, Update, and Delete operations by using a query builder to define conditions. To specify which users the conditions apply to, select the user role in the table. You can select Allow if user created the row from the action menu to limit an operation to the user who created the row. The menu also has Cut and Copy options for you to move conditions from one role or operation to another.
    Description of bo-security-condition.png follows
    Description of the illustration bo-security-condition.png

Allow External Access to Your Business Objects

When configuring security, you can allow external clients to access the business objects in your application through their REST endpoints. For example, you might want an external service like Process Automation to update a business object after a process is complete, say change a status field from "requested" to "approved".

To do this, you need to retrieve the API for the catalog of endpoints exposed by your application's business objects, found in the Catalog API panel in the Business Objects tab of your application's Settings editor:



The Development, Staging, and Live versions of your visual application each have their own catalog APIs. Though the URLs for the Staged and Live applications are provided for development purposes, they will not provide any results until the applications are staged or published.

Tip:

For each URL, click the Clipboard icon to quickly copy the URL to your clipboard.
Accessing the catalog APIs requires authentication. To set up security options for allowing access to the business object APIs:
  1. Open the Business Objects tab in the visual application’s Settings editor.
  2. Under Security, select an authentication option:
    • Allow anonymous access to business objects describe end point
    • Enable basic authentication for business object REST APIs
If you choose to allow anonymous access to the Describe endpoint, external clients accessing the endpoint will still need to add the header "Authorization: Public" to the request. The header is injected automatically for requests sent from your visual applications. Here's how you can add the header for requests from external clients:
  • Include auth in the Describe endpoint URL, for example:

    https://servicename-cloudaccount.test.oraclecloud.com/ic/builder/rt/myapp/1.0/resources/auth/data/describe?metadataMode=minimal

  • Add the “Authorization: Public” header to the request, for example, from the cURL command line:

    curl -v https://servicename-cloudaccount.test.oraclecloud.com/ic/builder/rt/myapp/1.0/resources/data/describe?metadataMode=minimal -H 'Authorization: Public'

Access to the data in business objects is based on authentication and user roles. For each business object you need to explicitly enable role-based security and specify the operations that each defined authentication and user role can perform. You configure the security settings in the business object's Security tab. See Allow Anonymous Access.

Note:

Applications in other domains might need to be added to the CORS allowlist of origins permitted to access applications in your domain. An administrator can add domains in Administrator Settings.

Additionally, for requests to access your APIs that are not made through a browser, the request might need to be explicitly modified to include an Origin header that matches the domain in the CORS allowlist. A more advanced alternative would be to add CSRF headers to POST requests that include the current CSRF token value and the session cookie so the server can match the token from the request with the one in the session cache.

Get an Access Token for Authentication

To access the APIs for the catalog or business objects from outside Visual Builder, you can get a bearer token to use with various authentication methods.

In the design-time, you can use the token to access any of your app's endpoints. At runtime, you can use the token to read the data in the app's business object.

When authentication is handled by IDCS, you can use the token with connections that are authenticated with OAuth using the following authentication methods:
  • Oracle Cloud Account
  • User Assertion OAuth 2.0
  • Client Credentials OAuth 2.0
  • Resource Owner OAuth 2.0

You cannot use the token with connections to Oracle Cloud Applications.

To generate a bearer token:

  1. Open the Business Objects tab in the visual application’s Settings editor.
  2. Click Get Access Token in the Security pane.

    The access token is generated and is displayed in the Access Token Value field. You can now copy the token and use it when accessing your application's APIs.