Authenticating clients for interacting with Cloudera AI Registry API

Clients that interact with the Cloudera AI Registry Standalone API and with model endpoints must obtain a JSON Web Token (JWT) from the Cloudera control plane, which must be passed as a Bearer token in HTTP requests sent to the serving API and endpoints.

For authenticating clients for interacting with Cloudera AI Registry API fulfill the prerequisites defined in Prerequisites for Cloudera AI Registry standalone API.
  1. To obtain a JWT token, run the following CDP CLI command.
    $ CDP_TOKEN=$(cdp iam generate-workload-auth-token --workload-name DE | jq -r
       '.token')

    In this example, DE is the workload name.

  2. Use the generated token in the HTTP request header.
    $ curl -H "Authorization: Bearer ${CDP_TOKEN}" <URL>

    The token obtained using this method expires in one hour.