Tokens
Token authentication is a string that if provided by a client, allows it to connect. It is the most straightforward authentication provided by the NATS server.
To use token authentication, you can specify an authorization
section with the token
property set:
Token authentication can be used in the authorization section for clients and clusters.
Or start the server with the --auth
flag:
A client can easily connect by specifying the server URL:
Bcrypted Tokens
Tokens can be bcrypted enabling an additional layer of security, as the clear-text version of the token would not be persisted on the server configuration file.
You can generate bcrypted tokens and passwords using the nats
tool:
Here's a simple configuration file:
The client will still require the clear-text token to connect:
Last updated