Reputation: 351
Docusign Authentication Guide says for system integration I should use JWT Grant. Since I am working on integration with defferent vendors - I have to get Admin consent for external applications. I did it. Then I generated OAuthToken with method RequestJWTApplicationToken (C# SDK). When I try to use this token
apiClient.Configuration.AddDefaultHeader("Authorization", "Bearer " + oAuthToken.access_token);
I receive an error:
{
"errorCode":"AUTHORIZATION_INVALID_TOKEN",
"message":"The access token provided is expired, revoked or malformed. Authentication for System Application failed."
}
Unfortunately all SDK examples are about Individual consent. Does anyone have C# example how to use JWT in case "external applications"?
Upvotes: 3
Views: 2442
Reputation: 49114
You must use the RequestJWTUserToken method when using JWT grant flow for the DocuSign eSignature API.
That JWT grant flow includes a user id (in guid format). The resulting access token that you receive from the authentication flow enables your app to impersonate the user id.
The DocuSign eSignature API does not accept application
JWT requests. The DocuSign Admin API does accept application
JWT requests, that's why the method is in the C# SDK. But the method does not apply to the eSignature API.
PS. Remember, when obtaining consent, to request both signature
and impersonation
scopes.
Upvotes: 9