Token Generation for Authentication in NetSuite

Generate tokens for authentication in NetSuite using Token Based Authentication (TBA) for secure access.

·3 min read·View Oracle Docs

Generating tokens for authentication is essential for securely accessing NetSuite functionalities using the Token Based Authentication (TBA) feature. This process enables developers and administrators to authenticate requests efficiently and securely.

Requirements for Token Generation

Before generating a token for authentication, ensure the following prerequisites are met:

  • Token Based Authentication Feature: This feature must be enabled in your NetSuite account, especially for production environments. For guidance, refer to the documentation on enabling the Token-Based Authentication feature.
  • User Role Permissions: Make sure you possess a NetSuite role that provides the necessary permissions to deploy and fetch data from NetSuite. The Administrator role has these permissions by default.

Generating an Initial Token for Authentication

To generate your first authentication token, follow these steps:

  1. When you run a gulp command for the first time to fetch or deploy, the Commerce developer tools will ask for an authentication ID. You can enter any alphanumeric string that represents your NetSuite account and role.
  2. You will be prompted to select which NetSuite account and role to use for the operation. If not logged in, you'll need to authenticate first.
  3. In the NetSuite interface, select the Allow button. This action generates the necessary token and secret for access.
  4. Once you see that the authentication process is proceeding in your CLI application, you can close the NetSuite window; the fetch/deploy continues in the Commerce developer tool.

Generating a New Token for Authentication

If you need to generate a new token, do the following:

  1. Use the --to parameter in your fetch or deploy command, as shown below:
    undefined

gulp extension:deploy --to

12. You will have the option to either select a saved token or create a new one.
2- Saved tokens from previous authentications are displayed by authentication ID and account.
3- For a new token, select **New token**.
43. Enter an alphanumeric string for the authentication ID, which denotes your NetSuite account and role.
54. You may have to choose your NetSuite account and role again unless you are already logged in.
65. Select the **Allow** button to proceed with generating the token and associated secret.
76. Again, once notified that the authentication process will continue in your CLI application, you can close the NetSuite interface.
8
9## Key Considerations
10- Keep in mind that after generating an initial token, you won't need to generate new tokens for each fetch or deploy unless specified.
11- For accounts with specific domains, specify your account number using the gulp command to fetch or deploy.
12
13## Who This Affects
14This information is relevant for:
15- **Developers** needing to set up secure connections to NetSuite.
16- **Administrators** responsible for enabling TBA and ensuring proper role permissions are assigned.
17- **Integration specialists** who work with external applications connecting to NetSuite.
18
19## Key Takeaways
20- Token Based Authentication is crucial for secure access to NetSuite functionalities.
21- Initial token generation can be done via the Commerce developer tools with proper role permissions.
22- New tokens can be created as needed without having to regenerate them for each operation.
23
24**Source**: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Do I need to enable any feature to use Token Based Authentication in NetSuite?
Yes, the Token Based Authentication feature must be enabled in your NetSuite account to use tokens for authentication, especially in production environments.
What permissions are required to generate a token in NetSuite?
You need a NetSuite role that provides the necessary permissions to deploy and fetch data. The Administrator role includes these permissions by default.
How do I generate a new token if I need one?
Use the `--to` parameter in your fetch or deploy command and follow the prompts to either select a saved token or create a new one by entering an alphanumeric string for the authentication ID.
Am I required to generate new tokens for every fetch or deploy?
No, once you have generated an initial token, you do not need to create new tokens for each fetch or deploy unless explicitly specified.
Source: Generate Tokens for Authentication Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Security

View all Security articles →