docusign / docusign-esign-node-client

The Official DocuSign Node.js Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
http://docusign.github.io/docusign-esign-node-client
MIT License
144 stars 99 forks source link

PKCE support in the SDK #333

Open nicolassanmar opened 10 months ago

nicolassanmar commented 10 months ago

DocuSign now supports PKCE since March 2023 https://www.docusign.com/blog/developers/docusign-adds-support-pkce. Unfortunately there is no way to make use of PKCE using the SDK, and I have not found workarounds.

We should add PKCE support to the SDK, and here are two different ways to do so:

  1. Abstract away PKCE by adding an initialization option enablePKCE: true to the ApiClient constructor, where code_challenge and code_verifier are added to requests under the hood.
  2. Add optional parameters to authentication functions to allow us to send our own code_challenge and code_verifier in each relevant call.
ByungjaeChung commented 10 months ago

DocuSign does not support Authorization Code Grant in our SDKs since it is webstack dependent. Instead, a generic (not DocuSign specific) OAuth library should always be used. Node for example is usually used with Passport. Some support PKCE, others do not.