Invoking Applications

This page lists different ways that you can invoke a OCI Generative AI application, after you create and deploy one.

The following instructions apply to applications that use identity domain bearer token authentication. For applications that use OCI IAM authentication, sign requests according to OCI IAM request-signing requirements. See Authentication.

For applications that use identity domain browser session authentication, browser users sign in through the identity domain. The hosted application service obtains access tokens on their behalf and establishes a browser session that uses a session cookie. For configuration steps, see Identity domain browser session.

Getting an Access Token

To invoke an application that uses identity domain bearer token authentication, obtain an OAuth access token from the associated OCI IAM identity domain and send it as a bearer token in the Authorization header. The following example uses the client credentials grant. See Access Token.

  1. Navigate to the detail page of the application to see which identity domain is associated for this application. If you need help listing the applications, see Listing Applications.
  2. Navigate to the detail page of the identity domain specified for the application. If you need help listing the identity domains, see Listing Identity Domains.
  3. Gather the following information for the identity domain and its confidential application. For help, see Setting Up Identity Domain Bearer Token Authentication and Client Credentials Grant Type.
    • IDCS_CLIENT_ID
    • IDCS_CLIENT_SECRET
    • IDCS_SCOPE
    • IDCS_DOMAIN_URL
  4. Here is an example script to create an access token.
    export IDCS_DOMAIN_URL="https://idcs-xxx.identity.oraclecloud.com:443"
    export IDCS_CLIENT_ID="<client-id>"
    export IDCS_CLIENT_SECRET="******************"
    export IDCS_SCOPE="https://example_application.com/read"
    curl -s -X POST "${IDCS_DOMAIN_URL}/oauth2/v1/token" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "grant_type=client_credentials" -d "client_id=${IDCS_CLIENT_ID}" \
    -d "client_secret=${IDCS_CLIENT_SECRET}" -d "scope=${IDCS_SCOPE}" | jq -r .access_token