Skip to content

trimble.id.testing SDK

The trimblecloud.id.testing SDK is a JavaScript SDK that provides a framework for automating the authentication process with Trimble Identity. As Trimble Identity will no longer support the password grant type, this SDK provides a workaround solution using the authorization grant with headless Chrome. Puppeteer is used to automate the browser and authenticate with Trimble Identity.

Getting Started

This SDK is available as an NPM package from Trimble Artifactory. To get started, see the instructions here.

Installation

To install, use the following command:

npm install @trimblecloudplatform/trimblecloud.id.testing

Usage

The SDK provides an Authenticator class that can be used to automate the authentication process with Trimble Identity.

The following example demonstrates how to use the Authenticator class to automate the authentication process and obtain an access token:

(async () => {
const authenticator = new Authenticator(
{
configurationEndpoint: '<CONFIGURATION_ENDPOINT>',
consumerKey: '<CONSUMER_KEY>',
scopes: '<SCOPES>',
redirectUri: '<REDIRECT_URI>',
identityProvider: '<IDENTITY_PROVIDER>'
}
);
await authenticator.signIn('<USERNAME>', '<PASSWORD>');
const accessToken = await authenticator.getAccessToken();
})();

Samples

You can find sample code for the SDK in the Trimble Identity Test Automation SDKs.