I recently wanted to switch my stuff to LXD to make deploy easier.
But I could not find a way to auth my json requests.
I got to the point, that I generated a cert, added that cert to the LXD node, I did already send the cert into the API but still it does not authenticate.
Can someone explain me, how do I auth on the web API?
I checked multiple documentations I could not figure out how.
From proxmox I am used, to send the credentials, I get tokens and I use them for further requests.
But here the API even refuses my generated cert.
Generating a RSA private key
................................++++
..........................................................................++++
writing new private key to 'client.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CA
State or Province Name (full name) [Some-State]:Quebec
Locality Name (eg, city) []:Montreal
Organization Name (eg, company) [Internet Widgits Pty Ltd]:stgraber.net
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:my client
Email Address []:
stgraber@castiana:~/api$ lxc config trust add client.crt
stgraber@castiana:~/api$ lxc config trust list
+--------------+-------------+-----------------------------+-----------------------------+
| FINGERPRINT | COMMON NAME | ISSUE DATE | EXPIRY DATE |
+--------------+-------------+-----------------------------+-----------------------------+
| 005e0a1c713f | my client | May 5, 2020 at 2:00pm (UTC) | May 5, 2021 at 2:00pm (UTC) |
+--------------+-------------+-----------------------------+-----------------------------+
stgraber@castiana:~/api$ curl -s -k https://localhost:8443/1.0 --cert client.crt --key client.key | jq .metadata.auth
"trusted"
stgraber@castiana:~/api$