.. _API Token: API Token ===================== .. contents:: :local: To enable API token for BLACKDAGGER, follow these steps: #. Set the environment variables to configure basic authentication: .. code-block:: bash export BLACKDAGGER_IS_AUTHTOKEN=1 export BLACKDAGGER_AUTHTOKEN="" Replace ```` with a random string of your choice. This string will be used as the API token for Blackdagger. #. Alternatively, create a ``config.yaml`` file in the ``$BLACKDAGGER_HOME`` directory (default: ``$HOME/.config/blackdagger``) to override the default configuration values. .. code-block:: yaml # API Token isAuthToken: true authToken: "" #. You can enable HTTPS by configuring the following environment variables: .. code-block:: bash export BLACKDAGGER_CERT_FILE="" export BLACKDAGGER_KEY_FILE="" Replace ```` and ```` with the paths to your certificate and key files. See :ref:`Configuration Options` for more information on the configuration file. #. Enable Basic Authentication as well if you want to use the Web UI along with the API token. **Without basic authentication config, you will not be able to access the Web UI.** .. code-block:: bash export BLACKDAGGER_IS_BASICAUTH=1 export BLACKDAGGER_USERNAME="" export BLACKDAGGER_PASSWORD="" Replace ```` and ```` with your username and password. See :ref:`Basic Auth` for more information on the basic authentication. See :ref:`REST API` for more information on the REST API.