1. Manage Accounts and Access
  2. Authenticate
  3. Use OAuth

Access Cloud API using OAuth 2.0

Use the following information to configure your applications to use the OAuth2 authentication mechanism for connecting to StreamNative Cloud API.

Configure StreamNative CLI

Use StreamNative CLI as a user account

You can follow the instructions in Organizations in StreamNative Cloud to sign in to an organization as a user account to use StreamNative CLI.

Use StreamNative CLI as a service account

In order to use StreamNative CLI as a service account, you need to download a credentials file for the service account you want to use. Please follow the instructions in Access Cloud Clusters to download the credentials file. We assume that the download credentials file is saved in /path/to/credentials.json.

Once you have the credentials file, you can activate the service account by running the following command:

snctl auth activate-service-account --key-file /path/to/credentials.json

If the service account is successfully activated, you will see a similar message below in your terminal running the command.

Logged in as sa@my_org.auth.streamnative.cloud.
Welcome to StreamNative Cloud!

You can also run snctl auth whoami to check which service account that snctl is using. It will return the princial name of this service account. Example message is shown below:

Access Cloud Clusters