Token-based authentication is a protocol that generates encrypted security tokens. It enables users to verify their identity to websites, which then generates a unique encrypted authentication token.
To use Token Based Authentication (TBA), the following things need to be done first:
- Enable Token-Based Authentication
- Create Integration record
- Create a Role and assign it to a User
- Create an Access Token for the Integration record, User, and Role
Enable Token-Based Authentication:
To enable TBA, Go to your NetSuite Setup > Company > Enable Features > Suite Cloud > Manage Authentication and then Enable Token-Based Authentication.
Create Integration record
An Integration record needs to be created to retrieve the Consumer Key and Consumer Secret
To create a new Integration record:
- Go to Setup > Integrations > Manage Integrations
- Click on the New button
- Give an appropriate name based on your project. Make sure to tick the Token-Based Authentication option, uncheck the “TBA: AUTHORIZATION FLOW” and “AUTHORIZATION CODE GRANT” option, and check the “TBA: ISSUETOKEN ENDPOINT” option.
- After saving the integration record, you will get the Consumer Key and Consumer Secret key
You must have to save the values retrieved for Consumer Key and Consumer Secret. You will not be able to retrieve them once you leave the confirmation screen.
Create a Role and assign it to a User
to create a Role and assign it to a User,
- Go to Setup > Users/Roles > Manage Roles > New
- Create a role and assign necessary permissions(depends on the requirement of the project)
- The role must have “User Access Tokens” permission for integration using TBA.
After creating this role, assign the role to the desired Employee that will be used for integration.
Go to Lists >Employees > Employees > edit user > Access tab > Roles sub-tab, and then add this role to the “Roles” sublist
Create an Access Token for the Integration record, User, and Role
- Go to Setup > Users/Roles > Access Tokens > New.
- Select the Integration record, User, and Role created in the previous steps.
Token Id and Token Secret will be displayed after tapping the save button.
As in the case of Integration record creation, here also you must have to save the values retrieved for Token Id and Token Secret. You will not be able to retrieve them once you leave the confirmation screen