Skip to content

Commit

Permalink
Add code snippet for python clients to support apache#17482
Browse files Browse the repository at this point in the history
  • Loading branch information
momo-jun committed Sep 14, 2022
1 parent e2d48d8 commit bd7f97d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions site2/docs/security-basic-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ authParams={"userId":"superuser","password":"admin"}

The following example shows how to configure basic authentication when using Pulsar clients.

<Tabs>
<TabItem value="Java" label="Java" default>
````mdx-code-block
<Tabs groupId="lang-choice"
defaultValue="Java"
values={[{"label":"Java","value":"Java"},{"label":"Python","value":"Python"},{"label":"C++","value":"C++"}]}>
<TabItem value="Java">
```java
AuthenticationBasic auth = new AuthenticationBasic();
Expand All @@ -142,7 +145,7 @@ The following example shows how to configure basic authentication when using Pul
```
</TabItem>
<TabItem value="C++" label="C++" default>
<TabItem value="C++">
```cpp
#include <pulsar/Client.h>
Expand All @@ -158,4 +161,12 @@ The following example shows how to configure basic authentication when using Pul
```
</TabItem>
<TabItem value="Python">
```python
if __name__ == "__main__":
client = Client("pulsar://broker.example.com:6650", authentication=AuthenticationBasic("admin", "123456"))
```
</TabItem>
</Tabs>

0 comments on commit bd7f97d

Please sign in to comment.