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.
With OAuth 2.0, you can choose between two options when authenticating with any of the SuiteCloud SDK tools:
-
Browser-based authentication: This option opens a new window or tab in your default browser, so you can authenticate your account-role combination. You'll need to interact with the browser for this option.
The first time you use browser-based authentication, you are asked to click Allow in the browser. For the subsequent occasions, you are asked to click Continue.
Warning:With browser-based authentication, you'll need to reauthorize each time your authorization details expire. You'll get a notification, and the browser will open for you to reauthorize.
-
Machine-to-machine authentication: This option uses digital certificates and needs some setup before you can authenticate your account-role combination. When it's set up, you don't need any user interaction.
This option is meant to be used for CI environments.
With machine-to-machine authentication, you need to enter the following details:
-
Account ID: References the NetSuite account ID.
-
Certificate ID: References the certificate ID you get from NetSuite after uploading the public key file.
-
Private key file: References the local path to the private key file that matches the certificate in NetSuite. For example:
d:/path/private-key.pem
.Important:To get 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 in the OAuth 2.0 Client Credentials Setup by choosing SuiteCloud Development Integration in the Application field and selecting the entity and role to map. This will generate a new row with 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're 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.