Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Inbound SSO Map PHP Help!!!!
We are using phptoolkit 2013. This code always throws exception "An unexpected error occurred."
global $nsendpoint, $nshost, $nsemail, $nspassword, $nsrole, $nsaccount, $partnerId;
$service = new NetSuiteService();
$role = new RecordRef();
$role->internalId = 3;
$priv_key_der = file_get_contents(APP_PATH . 'rsa-Private.der');
$priv_key_pem = chunk_split(base64_encode($priv_key_der), 64, "\n");
$priv_key_pem = "-----BEGIN RSA PRIVATE KEY-----\n" . $priv_key_pem . "-----END RSA PRIVATE KEY-----\n";
$priv_res = openssl_pkey_get_private($priv_key_pem);
$timestamp = round(vsprintf("%d%d", gettimeofday()), -3) / 1000;
$userId = $nsemail;
$ssotoken = $role->externalId . " " . $nsemail . " " . $timestamp;
openssl_private_encrypt($ssotoken, $ssotokenEnc, $priv_res);
$authToken = strtoupper(bin2hex($ssotokenEnc));