> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/patchworks-connectors/netsuite-prebuilt-connector/oauth-1-authentication.md).

# OAuth 1 authentication

## Introduction

When a user chooses to [add a connector instance](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md) using **OAuth 1** authentication, they are required to enter the following credentials:

| Credential            | Notes                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Consumer key`        | Generated in Netsuite as part of your initial Patchworks integration. For more information see: [Consumer key & consumer secret.](#consumer-key-and-consumer-secret)                                                                                                                                                                                                                                                                                                  |
| `Consumer secret`     | Generated in Netsuite as part of your initial Patchworks integration. For more information see: [Consumer key & consumer secret.](#consumer-key-and-consumer-secret)                                                                                                                                                                                                                                                                                                  |
| `Account id`          | This is always the first element of the URL that you can see having logged into NetSuite. For more information see: [Consumer key & consumer secret.](#consumer-key-and-consumer-secret)                                                                                                                                                                                                                                                                              |
| `Token`               | Generated per user in Netsuite. For more information see: [Token key & token secret](#token-key-and-token-secret).                                                                                                                                                                                                                                                                                                                                                    |
| `Token secret`        | Generated per user in Netsuite. For more information see: [Token key & token secret](#token-key-and-token-secret).                                                                                                                                                                                                                                                                                                                                                    |
| `Signature algorithm` | Always set to `sha256`.                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `Signature method`    | Always set to `HMAC-SHA256`.                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `Realm`               | <p>For a NetSuite sandbox the <code>accountid</code> shown in NetSuite (as opposed to your NetSuite URL) typically includes an <code>-SB</code> element - for example: <code>1234567-SB1</code>.</p><p>The <code>realm</code> will be the same value EXCEPT that the <code>-SB</code> element changes from a dash to an underscore.</p><p>So, an <code>accountid</code> of <code>1234567-SB1</code> becomes <code>1234567\_SB1</code> for the <code>realm</code>.</p> |

## Setting up OAuth 1 authentication

In order to add connector instances for NetSuite using OAuth 1 authentication, you must have completed all generic setup detailed in our [Preparing your NetSuite environment to work with Patchworks](/product-documentation/connectors-and-instances/patchworks-connectors/netsuite-prebuilt-connector/preparing-your-netsuite-environment-to-work-with-patchworks.md) guide.

## Finding your credentials

{% hint style="warning" %}
If you are using a custom version of our prebuilt NetSuite connector (i.e. if authentication method and/or endpoint settings have been updated after the original installation), please be aware that your settings and requirements may vary.
{% endhint %}

### Consumer key & consumer secret

If you have followed our [Preparing your NetSuite environment to work with Patchworks](/product-documentation/connectors-and-instances/patchworks-connectors/netsuite-prebuilt-connector/preparing-your-netsuite-environment-to-work-with-patchworks.md) guide, you will have added a Patchworks integration and saved your client credentials (`consumer key`/`client id` and `consumer secret`/`client secret`) to a password manager.

If you can't find these credentials, a new set can be generated.

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/53vi5yxtLCo2zL5TC62O)

</details>

{% hint style="danger" %}
Be aware that if you reset credentials that have already been used to configure Patchworks [connector instances](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md), process flows will fail until you [apply the new credentials](/product-documentation/connectors-and-instances/working-with-instances/updating-an-instance.md).
{% endhint %}

### Account ID

This is always the first element of the URL that you can see having logged into NetSuite. For example, with the following URL:\
\
`https://tstdrv1431250.app.netsuite.com/app/center/card.nl?sc=-29&whence=`

...the **account id** would be:\
\
`tstdrv1431250`

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/tZLVS70mJi8c5MMMtcYA)

</details>

### **Token key & token secret**

A **token key** and **token secret** can be generated for users with a Patchworks integration role. In NetSuite, navigate to `setup` <mark style="color:red;">|</mark> `users/roles` <mark style="color:red;">|</mark> `access tokens`.

These values should be added to a password manager at the time they are generated as they can't be re-accessed in NetSuite. If you can't find these credentials, a new set can be generated.

<details>

<summary><img src="/files/JOYoP4EdSu7WJ3CMdAAS" alt="" data-size="line"> Show me</summary>

![](/files/BjxafnTki8ah07po7aFE)

</details>

{% hint style="danger" %}
Be aware that if you reset credentials that have already been used to configure Patchworks [connector instances](/product-documentation/connectors-and-instances/working-with-instances/adding-an-instance.md), process flows will fail until you [apply the new credentials](/product-documentation/connectors-and-instances/working-with-instances/updating-an-instance.md).
{% endhint %}
