Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,10 @@ This folder contains an extensive collection of Hazelcast C++ Client code sample

**tls** — Example for showing how to configure SSL/TLS encryption for cluster communication.

**transactions** — Illustrates the usage of transactions in the cluster.
**transactions** — Illustrates the usage of transactions in the cluster.

## How to Build and Run the Examples

See reference
manual [Advanced Installation section](https://docs.hazelcast.com/hazelcast/latest/clients/cplusplus#advanced-installation)
to build and run the examples.
21 changes: 21 additions & 0 deletions examples/authentication/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# username_password_authentication

- Start server:
```bash
java -Dhazelcast.config=./examples/authentication/hazelcast-username-password.xml -jar hazelcast-<VERSION>.jar
```
- Run client test:
```bash
./build/examples/authentication/username_password_authentication
```

# token_authentication

- Start server:
```bash
java -Dhazelcast.config=./examples/authentication/hazelcast-token-credentials.xml -jar hazelcast-<VERSION>.jar
```
- Run client test:
```bash
./build/examples/authentication/token_authentication
```
12 changes: 11 additions & 1 deletion examples/authentication/hazelcast-token-credentials.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-config-4.0.xsd">
http://www.hazelcast.com/schema/config/hazelcast-config-5.6.xsd">
<cluster-name>token-credentials-dev</cluster-name>

<security enabled="true">
<realms>
Expand All @@ -27,5 +28,14 @@
</identity>
</realm>
</realms>
<client-permissions>
<map-permission name="MyMap" principal="*">
<actions>
<action>create</action>
<action>read</action>
<action>put</action>
</actions>
</map-permission>
</client-permissions>
</security>
</hazelcast>
11 changes: 10 additions & 1 deletion examples/authentication/hazelcast-username-password.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<hazelcast xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.hazelcast.com/schema/config
http://www.hazelcast.com/schema/config/hazelcast-config-4.0.xsd">
http://www.hazelcast.com/schema/config/hazelcast-config-5.6.xsd">

<security enabled="true">
<realms>
Expand All @@ -27,5 +27,14 @@
</identity>
</realm>
</realms>
<client-permissions>
<map-permission name="MyMap" principal="*">
<actions>
<action>create</action>
<action>read</action>
<action>put</action>
</actions>
</map-permission>
</client-permissions>
</security>
</hazelcast>
Loading