Skip to Content

Authentication & Security

Secure your embed

Keep keys on your server, scope each token to one client and allow only your domains.

An embed is secure when your backend decides who sees what. Databrain then enforces it on every query.

Checklist

AreaDo this
API keyKeep the data app API key on your server. Never send it to the browser.
Store the keyThe full API key is shown once, when you create or rotate it. Store it then. Lists show only the last 4 characters.
TenantSet clientId from your own session on the server, never from a browser value.
PersonSend params.userIdentifier, so private items belong to one person.
RowsUse params.tableAppFilters or app filters for limits inside a client. Viewers cannot change token values.
DashboardsUse params.allowedEmbeds to list the dashboards a token can open.
ExpirySet a short expiryTime. The default is 24 hours. Create a new token after a role change.
DomainsAdd only your app’s domains to the whitelisted domains. Other origins get 403 UNAUTHORIZED_ORIGIN.
FeaturesTurn on only the end-user features you need in the embed’s Access control.

How Databrain enforces scope

  • Every query runs with the token’s clientId and the datasource’s tenancy level.
  • tableAppFilters limits every query that reads that table. A query it cannot filter is refused.
  • An embed request from a domain that is not whitelisted is refused with HTTP 403.
  • Token values are stored on the server with the token. The browser only holds the token ID.

A SQL value in an app filter that fails or returns no rows runs the chart without that filter by default. Do not use SQL values as your only row limit. Use tableAppFilters or clientId tenancy.

Reports and certificates

Get Databrain’s current security documents from the Databrain security page.

Next, set up multi-tenant access control.