Authenticating clients for interacting with AI Registry API
Clients that interact with the AI Registry Standalone API and with model endpoints must obtain a JSON Web Token (JWT) from the Cloudera Data Platform control plane, which must be passed as a Bearer token in HTTP requests sent to the serving API and endpoints.
To obtain JWT, run the following Cloudera Data Platform CLI command:
$ CDP_TOKEN=$(cdp iam generate-workload-auth-token --workload-name DE | jq -r
'.token')
In this comment, DE is the workload name.
Then pass CDP_TOKEN in the HTTP request header as follows
$ curl -H "Authorization: Bearer ${CDP_TOKEN}" <URL>
The token obtained using this method expires in one hour.