Giter Site home page Giter Site logo

accesstokendemo's Introduction

AccessTokenDemo

DocuSign DevCon Conference: Access Token Generator Demo

-- Don't be scared, give it a whirl! --

To run this demo:

  1. Open this repository locally and run npm install.
  2. Login to your DocuSign developer account located at developers.docusign.com. Visit My Apps and Keys and save the user id at Impersonation Guid in index.js.
  3. Create a new integration for your DocuSign Developer account on your apps and keys page. Save the Integration key in index.js.
  4. Edit this new integration and create a new RSA keypair. Save the private key as a file named private.key in the same directory as index.js.
  5. Run it! node index.js -> click the link to login (a first time) and grant application consent*
  6. Run it again! node index.js to see a generated access token, user info, and (if configured) an organization ID.

* Before you can make any API calls using JWT Grant, you must get your user’s consent for your app to impersonate them.

Under the hood

This is a simple node.JS script that harnesses the DocuSign eSignature and Admin SDKs to complete the OAuth portion of a DocuSign integration. DocuSign SDKs harness promises in Node which means you'll need to resolve callbacks using promise chains ( like .then({}).catch({}).finally({}) ) OR using Async/Await functions.

For the sake of simplicity I've gone about it using an Immediately invoking function expression, due to superior readability. As a bonus, I kept a small portion of the old code commented for you to glean ideas from.

Finally, in an attempt to make this code resuable for others, I've created a parent DS function that binds all methods into their own child functions under this parent DS object, (as in DS.getUserInfo() or DS.getJWT()). This will allow you modularize the code to use in other scripts (like export default DS;, import DS from {DS}; )

accesstokendemo's People

Contributors

aaronwds avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.