To authenticate with Encord you must register a public key in the Encord platform. See our documentation here to learn more. Users can only access Projects, Datasets, and Ontologies from within their Workspace.
Authentication must occur every time an SDK script is run.
Ensure your private key is not password protected. All private keys generated on the Encord platform as described in
our documentation are not password protected by default.
After registering a public key, use the corresponding private key to authenticate your EncordUserClient. The following code sample needs to be included in all SDK interactions, and hence is included in all code snippets we provide in these tutorials.
We recommend using the file path to your private key, rather than the private key itself when authenticating.
The following script must be added to all Encord SDK scripts. It is present in all complete code examples we provide.
Authenticate with a Bearer Token
If a script or service cannot store your private key, you can authenticate with a bearer token instead. Use an SSH-authenticated client to generate the token with get_bearer_token(), then pass the token to EncordUserClient.create_with_bearer_token().
A bearer token grants the same access as your private key. Store it securely and never commit it to version control.
US Customers
If you are using Encord’s US based hosted platform, ALL authentication for the SDK MUST include the following: