Machine-to-Machine Authentication (CI/CD)
Machine-to-machine authentication uses two environment variables:
-
SUITECLOUD_CI: Set this to 1 (preferred) or anything other than zero to run operations in a CI/CD environment using machine-to-machine authentication.
-
SUITECLOUD_CI_PASSKEY: Set the passkey you'll use to create the credentials file. The passkey needs 32 to 100 alphanumeric characters and should be updated regularly.
Important:When you change the passkey, your current credentials file won't work anymore. After changing it, you'll need to delete the old credentials file and set up your account again.
To set up and manage authentication IDs for machine-to-machine authentication, you only need to set the SUITECLOUD_CI_PASSKEY environment variable. To use the authentication IDs to run operations that need authentication, you need to set both the SUITECLOUD_CI_PASSKEY and SUITECLOUD_CI environment variables.
When you use machine-to-machine authentication, SuiteCloud SDK creates the credentials file (credentials_ci.p12) and encrypts it with the passkey you set in the SUITECLOUD_CI_PASSKEY environment variable. When you do operations that require NetSuite authentication, SuiteCloud SDK retrieves the passkey from the environment variable and uses it to decrypt the credentials file.
To use your authentication credentials in your CI/CD environment, here's what you need to do:
-
Upload the
credentials_ci.p12file to your CI/CD environment securely. -
Set the
SUITECLOUD_CI_PASSKEYenvironment variable in your CI/CD environment and use the same passkey you used to create the credentials file. -
Set the
SUITECLOUD_CIenvironment variable to 1 in your CI/CD environment to enable machine-to-machine authentication.
With the credentials and environment variables set, SuiteCloud SDK tools can do operations that need NetSuite authentication in the CI/CD pipeline.
For more information, see Using Machine-to-Machine Authentication for CI/CD Environments.
For information about setting environment variables for different operating systems, see Setting Up Environment Variables for SuiteCloud SDK Tools.