Skip to main content
Work with Tesouro’s Implementation team to get set up with access to our environment and configure your branding.

Authentication

The first steps for integrating with Tesouro are to:
  1. Activate your developer account
  2. Receive your API access key credentials
  3. Create and authenticate your first JSON Web Token (JWT) to Tesouro.

Access your organization’s API access key credentials

Your organization’s API access key and secret are created by Tesouro and shared with you. To receive access:
  1. Have your designated team lead submit your access request here (external site managed by Tesouro)
  2. Tesouro will email you an API access key and secret that will require passwordless authentication via email address.

Create and authenticate your JWT

Create a JWT, then add it to the header of your call to query the Tesouro Sandbox environment
Authentication Request
Authentication Request
Example Request
Example Response
For production, use https://api.tesouro.com/graphql instead of https://api.sandbox.tesouro.com/graphql with production credentials

Token Exchange for User Impersonation

For seamless widget and API experiences, Tesouro supports OAuth 2.0 Token Exchange (RFC 8693). This allows your application to impersonate users on the Tesouro platform by exchanging a user JWT for an access token.
Token Exchange Request
Token Exchange Response
Subject Token Requirements: Your JWT must include both the user’s unique identifier in the sub claim and the user’s email address in the email claim. The returned access token contains RFC 8693 delegation claims indicating it’s an impersonated token.
Security: Users can only be impersonated within their assigned application context. Cross-application impersonation is prevented for security.

Widget Authentication

Embedded components authenticate each user with a widget token: an encrypted JWE that your backend mints, wrapping a token exchange request for that user. Tesouro provides the client ID, client secret and 32-byte widget secret it needs during onboarding. User token documents the token’s claims, encryption and lifetime.

Additional resources

Learn more about JWTs and OAuth 2.0 Token Exchange (RFC 8693)