NATS.io example setup to use JWT and NAS for authentication/authorization
Tested on linux, ensure you have a recent version of
- docker
- docker-compose
- make
- Run
make setup
to initialize the accounts, seesetup.sh
for details - Run
make box
and insert the commandnsc list accounts
. - Copy the
Public key
for SYS account from the output toconfig/nats-server.conf
in thesystem_account
field. - Reload NATS to pickup the configuration
docker-compose restart nats
- Update the keys/JWT parameters with
make push
Using the user1
credential, the client should connect and subscribe to user.user1.>
but not others. Also support protocols such as websocket, nats, mqtt. The limit of concurrent connections is 25.