Coder Social home page Coder Social logo

mrosicki / eg-03-python-auth-code-grant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from docusign/code-examples-python

0.0 0.0 0.0 742 KB

Python code examples

License: MIT License

Python 68.21% CSS 1.19% JavaScript 3.01% HTML 27.52% Shell 0.07%

eg-03-python-auth-code-grant's Introduction

Python: Authorization Code Grant Examples

Github repo: eg-03-python-auth-code-grant

Introduction

This repo is a Python 3 application that demonstrates:

  • Authentication with DocuSign via the Authorization Code Grant flow. When the token expires, the user is asked to re-authenticate. The refresh token is not used in this example.
  1. Embedded Signing Ceremony. Source. This example sends an envelope, and then uses an embedded signing ceremony for the first signer. With embedded signing, the DocuSign signing ceremony is initiated from your website.
  2. Send an envelope with a remote (email) signer and cc recipient. Source. The envelope includes a pdf, Word, and HTML document. Anchor text (AutoPlace) is used to position the signing fields in the documents.
  3. List envelopes in the user's account. Source. The envelopes' current status is included.
  4. Get an envelope's basic information. Source. The example lists the basic information about an envelope, including its overall status.
  5. List an envelope's recipients Source. Includes current recipient status.
  6. List an envelope's documents. Source.
  7. Download an envelope's documents. Source. The example can download individual documents, the documents concatenated together, or a zip file of the documents.
  8. Programmatically create a template. Source.
  9. Send an envelope using a template. Source.
  10. Send an envelope and upload its documents with multpart binary transfer. Source. Binary transfer is 33% more efficient than using Base64 encoding.
  11. Embedded sending. Source. Embeds the DocuSign web tool (NDSE) in your web app to finalize or update the envelope and documents before they are sent.
  12. Embedded DocuSign web tool (NDSE). Source.
  13. Embedded Signing Ceremony from a template with an added document. Source. This example sends an envelope based on a template. In addition to the template's document(s), the example adds an additional document to the envelope by using the Composite Templates feature.
  14. Payments example: an order form, with online payment by credit card. Source.

Installation

Prerequisites

  1. A DocuSign Developer Sandbox account (email and password) on demo.docusign.net. Create a free account.

  2. A DocuSign Integration Key (a client ID) that is configured to use the OAuth Authorization Code flow. You will need the Integration Key itself, and its secret.

    If you use this example on your own workstation, the Integration key must include a Redirect URI of http://localhost:5000/ds/callback

    If you will not be running the example on your own workstation, use the appropriate DNS name and port instead of localhost

    This video demonstrates how to create an Integration Key (client id) for a user application like this example. Note that the redirect url for your Integration Key will be http://localhost:5000/ds/callback if you use the default Python settings.

  3. Python 3.

  4. A name and email for a signer, and a name and email for a cc recipient.

Installation steps

  1. Download or clone this repository to your workstation to directory eg-03-python-auth-code-grant

  2. cd eg-03-python-auth-code-grant

  3. pip3 install -r requirements.txt (or pipenv can be used)

  4. Update the file app/ds_config.py with the Integration Key and other settings.

    Note: Protect your Integration Key and secret--you should ensure that ds_config.py file will not be stored in your source code repository.

  5. python3 run.py

  6. Open a browser to http://localhost:5000

Payments code example

To use the payments example, create a test payments gateway for your developer sandbox account.

See the PAYMENTS_INSTALLATION.md file for instructions.

Then add the payment gateway account id to the app/ds_config.py file.

Using the examples with other authentication flows

The examples in this repository can also be used with either the Implicit Grant or JWT OAuth flows. See the Authentication guide for information on choosing the right authentication flow for your application.

License and additional information

License

This repository uses the MIT License. See the LICENSE file for more information.

Pull Requests

Pull requests are welcomed. Pull requests will only be considered if their content uses the MIT License.

eg-03-python-auth-code-grant's People

Contributors

larryklugerds 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.