OAuth 2.0 Authentication for SuiteCloud SDK
SuiteCloud SDK uses the OAuth 2.0 protocol for authorization. To use this protocol, you need to have the OAuth 2.0 feature enabled in the account.
The OAuth 2.0 protocol allows you to choose between two options when authenticating with any of the SuiteCloud SDK tools:
-
Browser-based authentication – This option opens a new window or tab from your default browser, so you can authenticate your account-role combination. This option requires user interaction.
The first time you select the browser-based authentication, you are asked to click Allow when prompted in the browser. For the subsequent occasions, you are asked to click Continue.
Warning:In the browser-based authentication option, you will need to reauthorize each time the authorization details expire. You will get a notification and the browser will open for you to reauthorize.
-
Machine-to-machine authentication – This option works with digital certificates and requires some previous configuration so you can authenticate your account-role combination. When the configuration is set, the machine-to-machine authentication doesn't need user interaction.
This option is meant to be used for CI environments.
In the machine-to-machine authentication, you need to enter the details of the following parameters:
-
Account ID – References the NetSuite account ID.
-
Certificate ID – References the certificate ID obtained from NetSuite after uploading the public key file.
-
Private key file – References the local path to the private key file matching the certificate in NetSuite. For example:
d:/path/private-key.pem
.Important:To obtain the certificate ID, you need to generate an RSA certificate. The RSA certificate has two parts: the public key and the private key.
Upload the public key into the OAuth 2.0 Client Credentials Setup by specifying SuiteCloud Development Integration in the Application field and selecting the entity and role to be mapped. This action generates a new row that will provide the certificate ID value.
The private key path value is the location where the private key is saved.
For more information about how to generate the RSA certificate, see Certificate Conditions.
For more information about how to upload the public key, follow the steps in OAuth 2.0 Client Credentials Setup.
-
If you are authenticating for the first time, use the browser-based authentication to get the integration record installed in your account.
To authenticate using SuiteCloud Extension for Visual Studio Code, see Adding an Account in SuiteCloud Extension for Visual Studio Code.
To authenticate using SuiteCloud IDE Plug-in for WebStorm, see Adding an Account in SuiteCloud IDE Plug-in for WebStorm.
To authenticate using SuiteCloud CLI for Node.js, see account:setup or account:setup:ci.
To authenticate using SuiteCloud CLI for Java, see authenticate or authenticateci.