未验证 提交 cd8b7c77 编写于 作者: Y Yong Zhang 提交者: GitHub

Add python oauth2 document (#7946)

**Motivation**

After #7813, the python client supports the oauth2 authentication as well. Add an example for it.
上级 7ab29d85
......@@ -132,3 +132,22 @@ client, err := pulsar.NewClient(pulsar.ClientOptions{
Authentication: oauth,
})
```
### Python client
To enable OAuth2 authentication in Python client, you need to configure OAuth2 authentication.
This example shows how to configure OAuth2 authentication in Python client.
```python
from pulsar import Client, AuthenticationOauth2
params = '''
{
"issuer_url": "https://dev-kt-aa9ne.us.auth0.com",
"private_key": "/path/to/privateKey",
"audience": "https://dev-kt-aa9ne.us.auth0.com/api/v2/"
}
'''
client = Client("puslar://my-cluster:6650", authentication=AuthenticationOauth2(params))
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册