Generate a SuiteSignOn Token

The following sample shows how to use generateSuiteSignOnToken(options) in a Suitelet script.

Note:

This script sample uses the define function, which is required for an entry point script (a script you attach to a script record and deploy). You must use the require function if you want to copy the script into the SuiteScript Debugger and test it. For more information, see SuiteScript 2.x Global Objects.

Important:

The value used in this sample for the suiteSignOnRecordId field is a placeholder. Before using this sample, replace the suiteSignOnRecordId field value with a valid value from your NetSuite account. If you run a script with an invalid value, an error may occur. Additionally, the SuiteSignOn record you reference must be associated with a specific script. You make this association in the SuiteSignOn record’s Connection Points sublist. For help with SuiteSignOn records, see Creating SuiteSignOn Records.

          /**
 * @NApiVersion 2.x
 * @NScriptType Suitelet
 */

// This script uses generateSuiteSignOnToken in a Suitelet.
define(['N/sso'], function(sso) {
    function onRequest(context) {
        var suiteSignOnRecordId = 'customsso_test'; //Replace placeholder values
        var url = sso.generateSuiteSignOnToken(suiteSignOnRecordId);
    }
    return {
        onRequest: onRequest
    };
}); 

        

Related Topics

SuiteScript 2.x Suitelet Script Type
SuiteScript 2.x Suitelet Script Type Code Samples
Backend Suitelets
N/sso Module

General Notices