Skip to main content

Authentication

Establish connection to an enclave

First, you need to authenticate with the platform. Please specify your user email as well as a valid API token generated for that account.

The code snippet provides an explanation of the steps involved in establishing a connection to an enclave using the Decentriq SDK. It mentions the need for authentication with the platform by specifying a user email and API token. It also demonstrates the creation of a Client object and a list of enclave specifications. Additionally, it explains the creation of an Auth object for user authentication and the subsequent creation of a Session object for communication with the driver enclave.

import decentriq_platform.legacy as dq

USER_EMAIL = "@@ YOUR EMAIL HERE @@"
API_TOKEN = "@@ YOUR TOKEN HERE @@"

client = dq.create_client(USER_EMAIL, API_TOKEN)
enclave_specs = dq.enclave_specifications.versions([
"decentriq.driver:v21",
"decentriq.sqlite-container-worker-32-64:v7",
"decentriq.python-ml-worker-32-64:v22",
"decentriq.python-synth-data-worker-32-64:v17"
])

auth, endorser = client.create_auth_using_decentriq_pki(enclave_specs)

session = client.create_session(auth, enclave_specs)
note

Create and manage your API tokens via the Decentriq UI - API tokens page.

Create access token