Log in with the Content Hub ONE CLI
To use the Content Hub ONE CLI, you need the client credentials, which you can obtain from the app. In Content Hub ONE, on the menu bar, click Integration > OAuth client and then copy the commands from the CLI Command section. There are two grant types, and both can be used to connect to tenants with the CLI.
Device - this is the preferred option because actions are performed in the context of a user, while the client credentials option falls back to a system user. With this option, you are prompted to log in to your account in order to grant access to the client.
Client credentials - this option is recommended for CI/CD pipelines and other automation, because authorization occurs without user interaction.
Both options use the
tenant add command, which has following parameters:
organization-id- the ID of the organization that the tenant is part of.
tenant-id- the ID of the tenant.
client-id- the OAuth client ID that you want to use for the authentication flow.
client-secret- the client secret for the specified OAuth client.
By default, tenant information is stored in the credential manager of the operating system (Credential Manager on Windows or Keychain on macOS). If there are problems accessing the store, set the following environment variable
SC_CH_ONE_CLI_CREDENTIALS_FALLBACK=true. You can also see tenant information in the Content Hub ONE app by clicking your avatar and then clicking your organization.
To log in to your Content Hub ONE instance using device authorization, run the following command:
ch-one-cli tenant add \ --organization-id <Organization ID> \ --tenant-id <Tenant ID> \ --client-id <Device: OAuth client ID>
Client credentials authorization
To log in to your Content Hub ONE instance using client credentials, run the following command:
ch-one-cli tenant add \ --organization-id <Organization ID> \ --tenant-id <Tenant ID> \ --client-id <Client credentials: OAuth client ID> \ --client-secret <Client credentials: OAuth client secret>