HTTP Service URL (TLS)
: The URL of Pulsar Admin HTTP service.Broker Service URL (TLS)
: The URL of Pulsar broker service....
.
sa
of organization my_org
. Both client_id
and client_secret
are required while the other fields are optional. Since the credentials file contains client_secret
, please make sure the credentials file is stored in a safe place.client_id
and client_secret
of your service account:
org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2
.
Secondly, you need to prepare the authentication parameters for OAuth2 authentication. The following table outlines the parameters required for configuring OAuth2 authentication.
Parameter | Description | Example | Required or not |
---|---|---|---|
type | OAuth 2.0 authentication type. Currently, Pulsar clients only support the client_credentials authentication type. | client_credentials (default) | Optional |
issuerUrl | The URL of the authentication provider which allows the Pulsar client to obtain an access token. Currently, StreamNative Cloud only support Auth0 as the identity provider. So the value here should be https://auth.streamnative.cloud . | https://auth.streamnative.cloud | Required |
credentialsUrl | The URL to the JSON credentials file. It supports the following pattern formats: file:///path/to/file data:application/json;base64,<base64-encoded value> | file:///path/to/my_service_account_key.json | Required |
audience | The OAuth 2.0 resource server identifier for a Pulsar cluster. In StreamNative Cloud, a Pulsar cluster is identified by a Uniform Resource Name (URN), which is in the following format urn:sn:pulsar:${your_orgnization_id}:${instance_name} . | urn:sn:pulsar:my_org:my_instance | Required for StreamNative OAuth2 but optional for OIDC Federation |
scope | The scope of an access request. For more information, see access token scope | api://pulsar-cluster-1/.default | Optional |
urn:sn:pulsar:my_org:my_instance
using OAuth2. Please notes:
audience
is required.scope
and/or audience
parameters accordingly.<PULSAR_ADMIN_URL>
and/or <PULSAR_BROKER_URL>
with the right admin and/or broker URL of your Pulsar cluster. You can get the service URLs in the Cluster Details page of the StreamNative Cloud Console.
urn:sn:pulsar:my_org:my_instance
with the right URN of your Pulsar cluster.
file:///path/to/credentials.json
with the right file path of your downloaded credentials file from the StreamNative Cloud Console.
urn:sn:pulsar:my_org:my_instance
using OAuth2.
<PULSAR_ADMIN_URL>
and/or <PULSAR_BROKER_URL>
with the right admin and/or broker URL of your Pulsar cluster. You can get the service URLs in the Cluster Details page of the StreamNative Cloud Console.
urn:sn:pulsar:my_org:my_instance
with the right URN of your Pulsar cluster.
file:///path/to/credentials.json
with the right file path of your downloaded credentials file from the StreamNative Cloud Console.