Skip to main content

NATS

Authentication#

There are several components within Benthos which utilise NATS services. You will find that each of these components support optional advanced authentication parameters for NKeys and User Credentials.

An in depth tutorial can be found here.

NKey file#

The NATS server can use these NKeys in several ways for authentication. The simplest is for the server to be configured with a list of known public keys and for the clients to respond to the challenge by signing it with its private NKey configured in the nkey_file field.

More details here.

User Credentials file#

NATS server supports decentralized authentication based on JSON Web Tokens (JWT). Clients need an user JWT and a corresponding NKey secret when connecting to a server which is configured to use this authentication scheme.

The user_credentials_file field should point to a file containing both the private key and the JWT and can be generated with the nsc tool.

More details here.