Reputation: 98
I'm trying to integrate DocuSign in our system. What I understood from the documentation is that we need to use JWT Authentication, because we ask organisation administrator for permission, and then, the users do not need to login when requesting a signature.
This is the url I use to obtain the admin consent:
The callback URL is called successfully with a code returned like this:
Callback_URL
?state=esignature_docusign&code=ConsentResponseCode
However, there are two problems here:
ConsentResponseCode
is a valid code in JWT format, but the payload is empty and the header looks like this: {
"typ": "MT",
"alg": "RS256",
"kid": "68185ff1-xxxx-xxxx-xxxx-689812203317"
}
ConsentResponseCode
):{
"error": "invalid_grant",
"error_description": "expired_client_token"
}
which is blocking us from look up the user by email.
Questions are:
How can I obtain UserID to create JWT request?
Do I need to obtain consent separately and perform an Authorisation Grant for the organisation admin account?
Upvotes: 0
Views: 693
Reputation: 49114
The code that you receive back from the consent process is actually the code for the authorization code grant flow. You should simply throw away that code (ignore it completely).
Remember that obtaining consent is a one-time operation per user that you will be impersonating. The consent record is maintained by DocuSign, it is not a cookie or anything else ephemeral.
You'll only need to repeat the consent process if the user specifically withdraws the consent that they previously granted you.
Upvotes: 1
Reputation: 14050
Upvotes: 1