JWT

JWT, or JSON Web Token, is an open standard to securely transmit data between parties as a JSON object. We use JWT in the Lightbits SDS for all API calls (lbcli and REST/GRPC). By default, the cluster will be created with a system JWT (Cluster Admin) and a default JWT that is associated with the default project Admin (can only do project level APIs on the default project). If you create more projects/tenants, you will have additional Admin JWTs for each project.

The JWT is stored in a Keyvault created in the managed resource group during deployment.

Get the System JWT from Azure Portal

  1. Log in to the Azure portal.
  2. Click the managed application that you created (it should be in the resource group that was defined during the deployment).
  1. Click the managed resource.
  2. You will see a list of all of the resources created for the cluster.
  3. Click the Keyvault.
  4. Go to the Access Control menu.
  1. Click Add Role Assignment.
  2. Select the Key Vault Secrets User role.
  3. Click Next.
  4. Click Add Member.
  1. Choose the user that will be able to read the JWT.
  2. Click Review and Assign.
  3. Go to the Secrets menu in the Keyvault.
  1. Click the system JWT or the Admin JWT of the default Project.
  2. Click the current version of the secret.
  3. Click Show Secret.
  4. Copy the secret value.

Get the System JWT from Azure CLI

You can also do this using Azure CLI.

  1. List all keyvaults in the subscription:

az keyvault list

  1. Select the relevant keyvault name and list all the secrets:

az keyvault secret list --vault-name <kv_name>

  1. Select the relevant Secret to show:

az keyvault secret show --vault-name <kv_name> --name <secret_name>

Once you have the JWT, it should be used in every lbcli or API call to the Lightbits cluster. For use in this document and examples, we refer to an environment variable called: $LIGHTOS_JWT

For example:

lbcli list nodes -J $LIGHTOS_JWT

What to Do with the JWT

It is recommended to save the system_jwt as an environment variable, so that it can be easily added to any lbcli or API command.

For example:

lbcli list nodes -J $LIGHTOS_JWT

You can also save the JWT in the lbcli configuration YAML file /etc/lbcli/lbcli.yaml. This allows you to perform additional lbcli management commands to the storage cluster without specifying the JWT in each command.

For example:

Bash
Copy

Once you have the JWT, you can start working on the lbcli or Lightbits APIs to create volumes and start mounting them on your clients.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard