Skip to content

Authentication

To enable authentication, you need to configure two settings:

  1. In config/spoc.toml, set authentication = true.
  2. Configure the keys in the config/.env/<environment>.toml file.

You can also set the keys via environment variables. Learn More

Key Generation

python main.py gen-keys[env.zmq]
public_key = "public-key-x7i+CS<BVZMJyXEX)H8?31k5o)?mQ"
secret_key = "secret-key-x(<$ES*$pZ3UmIPEIy+lt1qNY!!Kn"

Configuration

Example Configuration:

config/spoc.toml
[spoc]
...
authentication = true

Authentication Keys

Example Configuration:

config/.env/production.toml
[env] # Environment Settings

[env.zmq] # ZeroMQ Configuration
public_key = "public-key-x7i+CS<BVZMJyXEX)H8?31k5o)?mQ"
secret_key = "secret-key-x(<$ES*$pZ3UmIPEIy+lt1qNY!!Kn"
server_key = "server-key-QAvkkf}^Y5OVu=R?S<V9Xi-Y!Zm4q" # IF Device

Server Key

The server_key is required if you are using devices. In this context, the "server" refers to the device. If you are not using devices, the server acts as the primary server, and you do not need to configure the server_key.

...
server_key = "server-key-QAvkkf}^Y5OVu=R?S<V9Xi-Y!Zm4q" # IF Device