The N/auth module provides utilities for managing token-based authentication (TBA) in SuiteScript β particularly useful for RESTlets and integration scripts that require authentication context management.
Changing Password (Administrative Use)
define(["N/auth", "N/log"], (auth, log) => {
// Change the current user password
auth.changePassword({
currentPassword: "OldPass123",
newPassword: "NewPass456!"
});
log.audit("Password changed", "Success");
return {};
});
About TBA in NetSuite
Token-Based Authentication (TBA) is the recommended authentication method for all NetSuite integrations. It uses a 4-part credential set: Consumer Key, Consumer Secret, Token ID, and Token Secret. TBA is configured in the NetSuite UI under Setup > Company > Enable Features > SuiteCloud, then under Setup > Integration > Manage Access Tokens.
Key Methods
| Method | Description |
|---|---|
auth.changePassword(options) | Change the current user’s NetSuite password |
auth.changeEmail(options) | Change the current user’s login email |