All versions of the developer tools, including the extension, theme, and SuiteCommerce Advanced (SCA) developer tools, must be updated to continue to support an ongoing secure implementation of token-based authentication. The updates described in these patch instructions are needed to remove the NLAuth authorization header from token-based authentication flows. Support for the the NLAuth authorization header ends with the release of SuiteCommerce/SuiteCommerce Advanced 2022.2.1.
Follow the steps in these procedures to update the developer tools for your SCA implementation:
- Modify the net.js File for Gulp Deployments
- Create a New Integration Record
- Create a New .env File
- Update Theme and Extension Developer Tools
- Generate a New Token for Authentication
Modify the net.js File for Gulp Deployments
The modifications to the net.js file are different depending on the version of SCA you have implemented. Be sure to follow the patch instructions appropriate for your version of SCA.
- net.js Modifications for SCA Kilimanjaro and Versions Running Node.js 11 and Earlier
- net.js Modifications for SCA 2020.2.3 and Earlier Versions
- net.js Modification for SCA 2020.2.4 and Later Versions
Create a New Integration Record
- In NetSuite, go to Setup > Integration > Manage Integrations > New
- Enter a Name for this integration record.
- On the Authentication tab, provide the following:
- Check the Token-Based Authentication box to enable it.
- Check the TBA: Authorization Flow box to enable it.
- Enter a URL in the Callback URL field.The callback URL is where the token-based authentication process responds with the token values. For example:
http://localhost:7777/tba
- Disable the Authorization Code Grant box and all other OAuth 2.0 options.
- Click Save.The confirmation page displays the Client Credentials (Consumer Key and Consumer Secret). You will need this information in the following steps.
Create a New .env File
- At the root level of the SCA source directory, create a new
.envfile. The root level of the SCA source directory is where thepackage.jsonfile resides.For example, if working with the 2019.2 release of SCA, the new.envfile resides in the following directory:SC_19.2_Live/.envThe contents of the new file should look like this:# .env file CONSUMER_KEY="446765bc51e70086cf582d32f0486fc0a764354ffec6c983b94e63af331346c4" CONSUMER_SECRET="97fda39654d2f0cf3f0f9011d97616f96a3136e2c7659b867e57a1e1bbbcc566"Copy - Replace the values for
CONSUMER_KEYandCONSUMER_SECRETshown in the preceding example with the values you copied from the integration record. - Save and close the .env file.
Update Theme and Extension Developer Tools
SCA versions Aconcagua and later support the theme and extension developer tools. If you are implementing one of these versions of SCA, you must replace your existing theme and extension developer tools with the updated theme and extension developer tools available with the 2022.1.1 minor release or later of the SuiteCommerce Extension Manager.
Generate a New Token for Authentication
After completing all updates outlined in the preceding sections, the first time you fetch or deploy using the SCA, extension, or theme developer tools, you will need to generate a new token. For more information, see Generate Tokens for Authentication.