docusign / docusign-esign-csharp-client

The Official Docusign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
https://developers.docusign.com/docs/esign-rest-api/sdks/csharp/
MIT License
130 stars 159 forks source link

Authentication issue with version 5.6.2. #342

Closed rgelb closed 2 years ago

rgelb commented 3 years ago

I have existing code that uses DocuSign.eSign library 4.1.1.0. It uses the following code to authenticate and create an envelope:

Dim clientAccountInfo As New ApiClient()
Dim authToken As OAuth.OAuthToken = clientAccountInfo .RequestJWTUserToken("xxxxx",  _
                    "xxxx", "account.docusign.com", Encoding.UTF8.GetBytes("xxxx"), 1)
Dim userInfo = clientAccountInfo .GetUserInfo(authToken.access_token)
Dim account = userInfo.Accounts.FirstOrDefault(Function(a) a.IsDefault = "true")

' setup the real api client that will be used for sending docs
Dim apiClient as new ApiClient(account.BaseUri & "/restapi")

Dim envelope as EnvelopeDefinition = CreateSomeEnvelope();
Dim envelopeApi As EnvelopesApi = New EnvelopesApi(apiClient.Configuration)
Dim summary As EnvelopeSummary = envelopeApi.CreateEnvelope(account.AccountId, envelope)

It works great. So I attempted to upgrade to version 5.6.2 and found that the API has changed a bit. For instance EnvelopeApi constructor takes the ApiClient instead of Configuration. But ok, I made the changes and it compiled.

However, the code blows up with the following error:

Error calling CreateEnvelope: {"errorCode":"PARTNER_AUTHENTICATION_FAILED","message":"The specified Integrator Key was not found or is disabled. An Integrator key was not specified."}'

Why is this happening and what am I missing?

RajRele commented 3 years ago

Can you confirm if you are still facing this issue? You can follow this unit test https://github.com/docusign/docusign-esign-csharp-client/blob/master/test/SdkNetCoreTests/JwtAuthNetCoreUnitTests.cs#L22

RajRele commented 2 years ago

Closing this due to inactivity! Please open a new issue if you have any questions. Thank you.