Search code examples
node.jspassport.jsdocusignapihapi

Can docusign-passport strategy be utilised in Hapi Js backend?


Since, Hapi Utilises its own separate JWT package. like - Bell || HapiAuthJWT2 .

And I failed to find any plugin which is being mantained for passport being able to handle Hapi Request APIs.

The alternative solution is probably to use the DocuSign server APIs directly.


Solution

  • docusign-passport is a plugin strategy for passport.

    Hapi's authentication appears to be different. Plus, you referenced JWT authentication. JWT grant is completely different from the Authentication Code grant flow used by passport and its plugins.

    The developer center includes information on creating a JWT token for the DocuSign IdPs.

    Note that the JWT is signed using the RS256 algorithm.

    Added

    Re: is a custom plugin needed for HAPI? I don't know, I haven't used HAPI. But even if DocuSign-specific code is needed, it should be straight-forward since DocuSign uses common patterns for its JWT and Authorization Code grant support.

    Re: JWT vs Passport. Passport is for authorization code grant. It works well for that OAuth flow. If you want to use the JWT grant flow, it is not supported by the Passport library, AFAIK.