Overview
The Strata API uses JWT tokens to authorize requests. Create an RSA key pair in the Strata Dashboard which provides a private key that can be used to generate signed JWT tokens. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.1. Create a signing key in the Strata dashboard
In the Strata dashboard, navigate to the Settings page by selectingSettings in the sidebar. Click Generate New Keypair to get a new signing key. Save the private key somewhere secure. You will not be able to see it again.
2. Generate signed user JWT tokens
Generate a JWT token. Use the following header:alg: The algorithm used to sign the JWT. Strata only supportsRS256.typ: The type of token. Must beJWT.
sub, iat, exp, project_id.
- project_id: Your Strata project ID. This can be found on the Settings page
- sub: The JWT subject. This is your primary identifier for the user.
- iat: The JWT issued at timestamp in seconds since the Unix epoch. Typically the current time.
- exp: The JWT expiration timestamp in seconds since the Unix epoch (must be later than the iat claim).
external_id claim. If provided, it will be used as the user / company identifier and takes precedence over the sub claim.
Here is a sample Node.js implementation: