Requests made to the API are usually authenticated with HTTP Basic authentication.
In order to properly authenticate with the API, you must use your API key as the username while leaving the password blank. Requests not properly authenticated will return a
401 error code. You can generate API keys for your account in your Profile Settings. All API requests must be made over HTTPS.
curl, you can specify the username with the
-u flag - make sure to include a
: afterwards, which indicates an empty password.
Note: If you're an Enterprise customer, you'll need to use your company's URL to authenticate (e.g. yourcompany.benchling.com instead of benchling.com).
curl -u sk_YOUR_SECRET_KEY: https://benchling.com/api/v2/plates
Benchling for Enterprise supports authenticating with OpenID Connect (OAuth2) access tokens. In this configuration, you'll have a trusted identity provider (such as Okta or AD FS) that supports OpenID Connect.
From your application, you can authenticate to the identity provider, which results in an access token. Your identity provider should be configured to include "email" as a claim in the token. You must then use the token in the Authentication header:
curl -H "Authentication: Bearer YOUR_ACCESS_TOKEN" https://benchling.com/api/v2/plates
The Benchling API accepts this token by verifying the signature against keys presented at your OpenID configuration endpoint (e.g. at https://example.com/.well-known/openid-configuration). Once the token signature is verified, the API request is authenticated as the user associated with the email claim on the token.
Note that the user must already exist - in most cases this means the user should sign into the web application before making API requests.
Contact firstname.lastname@example.org to configure OpenID Authentication.