Skip to content

Commit cc3ecfd

Browse files
Update kop/java/README.md
Co-authored-by: Huanli Meng <48120384+Huanli-Meng@users.noreply.github.com>
1 parent a8bfa36 commit cc3ecfd

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

kop/java/README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,24 @@ See [KoP Security](https://github.com/streamnative/kop/blob/master/docs/security
6969

7070
## Example: OAuth2 authentication
7171

72-
See [KoP Security](https://github.com/streamnative/kop/blob/master/docs/security.md#oauthbearer) for how to configure KoP with oauth authentication. This example takes a topic named `my-topic` under `public/default` namespace as reference.
73-
1. Start the hydra OAuth2 Server
72+
See [KoP Security](https://github.com/streamnative/kop/blob/master/docs/security.md#oauthbearer) for how to configure KoP with OAuth authentication. This example takes a topic named `my-topic` under `public/default` namespace as reference.
73+
1. Start the Hydra OAuth2 server.
7474

75-
Start hydra server
75+
Start the Hydra OAuth2 server.
7676
```shell
7777
docker-compose -f $(git rev-parse --show-toplevel)/kop/java/src/main/resources/hydra/docker-compose.yml up -d
7878
```
79-
Init the hydra server
79+
Initialize the Hydra OAuth2 server.
8080
```shell
8181
./$(git rev-parse --show-toplevel)/kop/java/src/main/resources/init_hydra_oauth_server.sh
8282
```
8383

8484
2. Configure the oauth in Pulsar
8585

86-
In this example it will use the follow value:
87-
> Need replace the privateKey value to your local credentials_file.json path.
86+
This example will use the follow values:
87+
> **Note**
88+
>
89+
> You need to replace the `privateKey` value with your local path to your `credentials_file.json` file.
8890
```properties
8991
# Enable the authentication
9092
authenticationEnabled=true
@@ -105,7 +107,7 @@ authorizationEnabled=true
105107
authorizationProvider=org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider
106108
```
107109

108-
3. Create a new oauth client
110+
3. Create a new OAuth2 client.
109111

110112
```shell
111113
docker run --rm \
@@ -121,7 +123,7 @@ docker run --rm \
121123
--audience http://example.com/api/v2/
122124
```
123125

124-
4. Create the credentials file json calls `credentials.json`
126+
4. Create a credentials file json named `credentials.json`
125127

126128
```properties
127129
{
@@ -139,11 +141,11 @@ docker run --rm \
139141
--actions produce,consume
140142
```
141143

142-
> **NOTE**
144+
> **Note**
143145
>
144146
> The `conf/client.conf` should be configured. For details, see [Configure CLI Tools](http://pulsar.apache.org/docs/en/security-jwt/#cli-tools).
145147
146-
6. Configure the oauth in [oauth.properties](src/main/resources/oauth.properties).
148+
6. Configure OAuth2 authentication parameters in [oauth.properties](src/main/resources/oauth.properties).
147149

148150
```properties
149151
bootstrap.servers=localhost:9092
@@ -184,10 +186,10 @@ docker run --rm \
184186
Receive record: hello from persistent://public/default/my-topic-0@0
185187
```
186188

187-
10. Stop the hydra server
189+
10. Stop the Hydra OAuth2 server.
188190

189191
```shell
190192
docker-compose -f $(git rev-parse --show-toplevel)/kop/java/src/main/resources/hydra/docker-compose.yml down
191193
```
192194

193-
11. Stop the Pulsar server
195+
11. Stop the Pulsar server.

0 commit comments

Comments
 (0)