How to Generate Token Password for SuiteAnalytics Connect (


I was trying to generate a token password using the script I made where the administrator can easily generate the token password on the page but was not successful because of the wrong signature.

This token password will be used to ODBC MS SQL Server Management Studio.

First, The script goal is to mirror the token password result in the SuiteAnswer (101883) – Creating the Token Password.

Here are the values we need to generate the base string:

Format ( Account ID & Consumer & Token & Nonce & Timestamp )

NetSuite account ID – 1234567
Consumer key – 71cc02b731f05895561ef0862d71553a3ac99498a947c3b7beaf4a1e4a29f7c4

Token – 89e08d9767c5ac85b374415725567d05b54ecf0960ad2470894a52f741020d82

Nonce – 6obMKq0tmY8ylVOdEkA1

Timestamp – 1439829974

To create Signature Key Format: (Consumer Secret & Token Password)

Consumer secret – 7278da58caf07f5c336301a601203d10a58e948efa280f0618e25fcee1ef2abd

Token secret – 060cd9ab3ffbbe1e3d3918e90165ffd37ab12acc76b4691046e2d29c7d7674c2

Here are the concatenated base string & signature key.

BASE STRING : 1234567&71cc02b731f05895561ef0862d71553a3ac99498a947c3b7beaf4a1e4a29f7c4&89e08d9767c5ac85b374415725567d05b54ecf0960ad2470894a52f741020d82&6obMKq0tmY8ylVOdEkA1&1439829974


Now the issue is how to generate the Signature.


Based on the suite answer signature result: the base string & signature key were encrypted using the HMAC-SHA256 algorithm then encoded to Base 64, finally concatenate the HMAC-SHA256 algorithm.

This signature was successfully generated in my test using the HMAC-SHA256 Online Generator:

Using this online generator, I put the base string in “Compute Hash” while entering the signature key to the “Secret Key” field then select the output text format as “Base64”, finally compute the hash.

It is successful using the online generator. but I failed in the script since the HMAC-SHA256 encryption parameter is the secret key only. there is no compute hash there.

See N/crypto -> crypto.createHmac:

var hmacObj = crypto.createHmac({

algorithm: crypto.HashAlg.SHA256,

key: sKey


I was not able to mirror the signature result in the suite answer using SuiteScript 2.0.

Can you please help me with how can I generate the Signature?
Once I generated a successful signature, I can finally concatenate it to the base string to create the token password.


Add Comment
1 Answer(s)



I am also looking for a “simple” script to generate a signature to use for role 57 “DWI” ODBC for

Any suggestions?


Many thanks,




Rookie Answered on March 30, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Become a Sponsor   Become a Sponsor