Registering Users

Device Registration #

A user is created in wag by registering a device, a user may have many devices but will not be present in the system until they have registered one device.

Create New Registration Tokens #

Under the Registration Tokens section, add a new token.

Token create dialog

Then copy the token from here:

Registration table

First generate a token with the registration command.

sh# ./wag registration -add -username tester
token,username
e83253fd9962c68f73aa5088604f3f425d58a963bfb5c0889cca54d63a34b2e3,tester

Accessing Tokens #

Wag listens and exposes a public API which, when supplied the generated token will generate and insert a device into the users device list. The following example uses curl, but mainly this shows how easy it is to automate.

curl http://public.server.address:8080/register_device?key=e83253fd9962c68f73aa5088604f3f425d58a963bfb5c0889cca54d63a34b2e3

The service will return a fully templated response:

[Interface]
PrivateKey = <omitted>
Address = 192.168.1.1

[Peer]
Endpoint =  public.server.address:51820
PublicKey = pnvl40WiRt++0NucEGexlpfwWA8QzBYg2+8ZWZJvejA=
AllowedIPs = 10.7.7.7/32, 192.168.1.1/32, 192.168.3.4/32, 192.168.3.5/32
PersistentKeepAlive = 10

Which can then be written to a config file and started

Previous
Next