Strategy

Strategy

new Strategy(options, verify)

Source:

Strategy constructor.

The docusign authentication strategy authenticates requests by delegating to
docusign using the OAuth 2.0 protocol.

Applications must supply a verify callback which accepts an accessToken,
refreshToken and service-specific profile, and then calls the cb
callback supplying a user, which should be set to false if the
credentials are not valid. If an exception occured, err should be set.

Options:

  • clientID your docusign application's App ID
  • clientSecret your docusign application's App Secret
  • callbackURL URL to which docusign will redirect the user after granting authorization

Examples:

passport.use(new docusignStrategy({
    clientID: 'YOUR-123-456-789',
    clientSecret: 'shhh-its-a-secret'
    callbackURL: 'https://www.example.net/auth/docusign/callback'
  },
  function(accessToken, refreshToken, profile, cb) {
    User.findOrCreate(..., function (err, user) {
      cb(err, user);
    });
  }
));
Parameters:
Name Type Description
options object
verify function

Methods

(protected) _convertProfileFields(profileFields) → {string}

Source:

Convert docusign profile to a normalized profile.

Parameters:
Name Type Description
profileFields object
Returns:
Type
string

(protected) authenticate(req, options)

Source:

Authenticate request by delegating to docusign using OAuth 2.0.

Parameters:
Name Type Description
req http.IncomingMessage
options object

(protected) authorizationParams(options) → {object}

Source:

Return extra docusign-specific parameters to be included in the authorization
request. Not supported yet!!!

Options:

  • display Display mode to render dialog, { page, popup, touch }.
Parameters:
Name Type Description
options object
Returns:
Type
object

(protected) parseErrorResponse(body, status) → {Error}

Source:

Parse error response from docusign OAuth 2.0 token endpoint.

Parameters:
Name Type Description
body string
status number
Returns:
Type
Error

(protected) userProfile(accessToken, done)

Source:

Retrieve user profile from docusign.

This function constructs a normalized profile, with the following properties:

  • provider always set to docusign
  • sub the user's docusign sub ID
  • name the user's full name
  • given_name the user's first name
  • family_name the user's last name
  • accounts an array containing all the DocuSign's accounts linked to the user
  • email the contact email address granted by the user
Parameters:
Name Type Description
accessToken string
done function