Skip to main content

Package: DocuSign.eSign.dll (8.0.0.0)

Environment: Asp.Net Core

Language: C#

Demo code:

DocuSignClient dsClient = new DocuSignClient(DocuSignClient.Demo_REST_BasePath);
DSAuth.OAuth.OAuthToken oaTok = default!;
List<string> scopes = new List<string>() { "signature", "impersonation" };
byte[] privateKey = File.ReadAllBytes("c:\\Test\\Private.key");

DSAuth.OAuth.OAuthToken tok = dsc.RequestJWTUserToken(
Properties["IntegrationKey"],
    Propertiese"UserId"],
    Propertiest"AuthServer"],
    privateKey,
    1,
    scopes); 

I have verified that the values for IntegrationKey, UserId, and the private key are set up in DocuSign correctly and turned on, and that I am using the correct values. I have verified that the authentication server is the correct one (demo.) But when I run this, it just hangs. No response. I have set this up to run asynchronously, and the same thing: it never resolves. 

This used to work, but it broke some time in late October I think it was. All of the example code I can find from DocuSign uses the now deprecated ApiClient. Since this is ASP Core, I no longer have ServicePointManager, and I cannot find any documentation on how to set the security protocol type. Wits end here, any help would be appreciated.

I don't see any particular issues in your code. Just one thing to check is the value of the Properties["AuthServer"], which should be set to "account-d.docusign.com" for the Demo environment.
I tested the same in my environment using the DocuSign.eSign.dll (8.0.0.0) but the issue hasn't occurred. I was able to get the access token without issue.

I would suggest initiating a support case with DocuSign for further troubleshooting as it may require inspecting the network trace. Here's the link to open the support case with DocuSign: https://support.docusign.com/s/articles/How-Do-I-Open-a-Case-in-the-DocuSign-Support-Center?language=en_US 


I think I may have a lead on what’s happening. I am developing and testing this in Visual Studio, so I have the Redirect URI on the app set to https://localhost:7278/ I am guessing that DocuSign is trying to post back, but there is no map back to my machine. What is the suggested fix? This is with a state government agency, so my options for “make my computer public-facing” is quite limited.


I am using https://localhost (with a channel number) as the redirect uri. It occurs to me that this might not resolve properly, although I was able to get this to work in the past. Another possible issue is that I work for a government agency: the app I am working on will be internal, so I will not be allowed to put this on a public-facing website. 


Closing this ticket, I hope it will stick around to help others.

The issue was that I had moved the DocuSign components into a separate project in the solution. Seems logical, keep all of the DocuSign specific classes and delegate in a single package. I set up a new instance to test just this one component and it worked fine. The only difference was that the test app had one project in the solution, not two.

So I dismantled the DocuSign project in my main app, moved the components to the main project along with the pages that actually call the component, and… no problems. Worked like a charm. No clue why the separate projects made a difference, but there it is. The code to request the OAuth token was being hit, just not returning; my guess is that the separate project was run on a separate thread, and ASP.Net Core was trying to send DocuSign’s response to the main thread, which was not waiting for a response, instead of the calling thread, which was.


Reply