0
votes

I have just started reading up docusign and have to implement it in my project using PHP. The requirement being, once user accepts the offer, he is directed to the document for signing. I understood the template and envelop creation but am stuck at the first step of authorization. I used the Legacy Header Authentication which is easy and works. But they are discouraging using this method anymore. So what to do instead of this? Thanks in advance.

1
Which php framework does your app use? Laravel, something else? Thanks. - Larry K
its using Laravel. - Sonal

1 Answers

1
votes

Is your application used to send out the request for signing?

If so, then the user of your application should probably have their own account on DocuSign. You should use OAuth authorization code grant to let your app's user login and send out the signing request.

For example, an employee uses your app to send out offer letters. In this case, your employee would authenticate himself to DocuSign via your app using OAuth Authorization Code Grant.

Or is the user of your application the signer who will be agreeing to something via DocuSign? If so then your app needs to create an envelope to be signed by the signer. Since the user of your application in this case is not a member of your company/organization, you need your app to impersonate someone who is a member of your org.

In this case, your app can use JWT authentication with impersonation to act on behalf of someone.

For example, your application is used by potential new employees to agree to the offered employment contract. In this case, the user of your app (the new employee) doesn't have a DocuSign login. So your app impersonates (using the JWT flow) an HR person in your company. Your app then, on behalf of the HR person, enables the new employee to sign the offer letter or generate new letter that will be sent for signing via DocuSign.

If JWT authentication fits your user case, we have a code example for PHP. See https://github.com/docusign/eg-01-php-jwt

We also have an Authorization code grant example for PHP.