You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -121,14 +112,24 @@ The **refresh token** is not used in this example.
121
112
Firstly, creates a bulk send recipients list, and then creates an envelope.
122
113
After that, initiates bulk envelope sending.
123
114
115
+
116
+
117
+
## Authentication types:
118
+
119
+
* Authentication with Docusign via [Authorization Code Grant flow](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-code-grant) .
120
+
When the token expires, the user is asked to re-authenticate.
121
+
The **refresh token** is not used in this example.
122
+
123
+
* Authentication with DocuSign via the [JSON Web Token (JWT) Grant](https://developers.docusign.com/esign-rest-api/guides/authentication/oauth2-jsonwebtoken).
124
+
When the token expires, it updates automatically.
125
+
124
126
## Installation
125
127
126
128
### Prerequisites
127
129
1. A DocuSign Developer Sandbox account (email and password) on [demo.docusign.net](https://demo.docusign.net).
128
130
Create a [free account](https://go.docusign.com/sandbox/productshot/?elqCampaignId=16534).
129
-
1. A DocuSign Integration Key (a client ID) that is configured to use the
130
-
OAuth Authorization Code flow.
131
-
You will need the **Integration Key** itself, and its **secret**.
131
+
132
+
1. A DocuSign Integration Key (a client ID). To use Authorization code grant, you will need the **Integration Key** itself, and its **secret**. To use JSON Web token, you will need the **Integration Key** itself, the **RSA Secret Key** and an API user ID for the user you are impersonating.
132
133
133
134
If you use this example on your own workstation,
134
135
the Integration key must include a **Redirect URI** of `http://localhost:5000/ds/callback`
@@ -141,35 +142,47 @@ The **refresh token** is not used in this example.
141
142
The signer and the cc email cannot be the same.
142
143
143
144
### Installation steps
144
-
1. Download or clone this repository to your workstation to directory **eg-03-node-auth-code-grant**
145
-
1.**cd eg-03-node-auth-code-grant**
145
+
1. Download or clone this repository to your workstation to directory **code-examples-nodejs**
146
+
1.**cd code-examples-nodejs**
146
147
1.**npm install**
147
148
1.*Either:*
148
149
149
-
* Update the file **ds_configuration.js** in the project's root directory
150
+
* Update the file **config/appsettings.json** in the project's root directory
150
151
with the Integration Key
151
152
and other settings, *or*
152
153
* Create and export environment variables for the settings.
153
-
See the **ds_configuration.js** file
154
+
See the **config/appsettings.json** file
154
155
for the names of the environment variables.
155
156
156
157
**Note:** Protect your Integration Key and secret--If you update
157
-
the ds_configuration.js file, then you
158
+
the config/appsettings.json file, then you
158
159
should ensure that it will not be stored in your source code
159
160
repository.
160
161
161
162
1.**npm start**
162
163
1. Open a browser to **http://localhost:5000**
163
164
165
+
### Configuring JWT
166
+
167
+
1. Create a developer sandbox account on developers.docusign.com if you don't already have one.
168
+
2. Create a new API key in the Admin panel: https://admindemo.docusign.com/api-integrator-key, take note of the public key.
169
+
3. Set a redirect URI of `http://localhost:5000/ds/callback` as mentioned in the installation steps above for the API key you make in step 2.
170
+
4. Generate an RSA keypair in the administrator console on the DocuSign developer sandbox and copy the private key to a secure location.
171
+
5. Create a new file in your repo source folder named **private.key**, and paste in that copied RSA private key, then save it.
172
+
6. Update the file **config/appsettings.json** and include the newly created API key from step 2 as well as your account user id GUID which is also found on the Admin panel: `https://admindemo.docusign.com/api-integrator-key`.
173
+
174
+
From there you should be able to run the launcher using **npm start** then selecting **JSON Web Token** when authenticaing your account.
175
+
176
+
164
177
#### Payments code example
165
178
To use the payments example, create a
166
179
test payments gateway for your developer sandbox account.
0 commit comments