Connect to a tdx Volt
The tdx Volt command line interface (CLI) and all client libraries make use of a JSON object stored in a local file to persist the details of a client connection to the Volt.
A full description of the client connection JSON format and how to obtain or create one can be found in the connection section.
api
The VoltAPI.Authenticate API enables clients to authenticate on a Volt and obtain credentials for subsequent API calls.
cli
Use the auth
command.
To authenticate on a Volt with the DID did:volt:a06e10d1-3fa4-445a-948f-7e7c5ee36262
use the following command:
By default, the configuration details will be stored in a file called volt.config.json
in the current working directory. You can specify a different file using the -c
switch:
You can use the discovery URL of the Volt instead of the DID:
javascript
Use the Authenticate API, the response will contain the generated credentials on success.
grpc
It’s not normally necessary to explicitly use the Authenticate
API when using the grpc client library, as the library will automatically authenticate if required when initialise
is called.
It’s worth noting that the initialise
call will not return until either a ‘permit’ or ‘deny’ decision is received from the Volt. This means that the initialise
call will block if there is a ‘prompt’ decision, which will occur if the Volt is configured to require user interaction for authentication.
Once the client has been initialised, the configuration will be stored in the file specified by configPath
. The next time the client is initialised, the configuration will be read from this file.
If you’d rather manage the persistence of the configuration yourself, you can pass a configuration object directly to the initialise
method rather than a file path: