docusign-esign-csharp-client icon indicating copy to clipboard operation
docusign-esign-csharp-client copied to clipboard

GenerateAccessToken returns "unsupported_grant_type" on 6.7.0

Open rjpr opened this issue 2 years ago • 3 comments

Calling DocuSignClient.GenerateAccessToken on SDK v6.7.0 returns the following exception:

DocuSign.eSign.Client.ApiException: Error while requesting server, received a non successful HTTP code with response Body: {"error":"invalid_grant","error_description":"unsupported_grant_type"} at DocuSign.eSign.Client.DocuSignClient.GenerateAccessToken(String clientId, String clientSecret, String code)

I eventually resolved the issue by downgrading to 6.6.0. After some investigation I suspect this has been caused by the changes to the request body here: https://github.com/docusign/docusign-esign-csharp-client/commit/bbc7e3df590ff5a961fb3efc239405367d3bc380#diff-ba42f5f1289226fd9b2414cf211518bd5cdd7a81e4d5764fe74fb90ee6b2ada7R91

rjpr avatar Oct 03 '23 23:10 rjpr

Thanks for submitting the issue. I was able to reproduce the same issue and reported internally.

ByungjaeChung avatar Oct 04 '23 05:10 ByungjaeChung

I had the same issue, and overrided the behaviour of DocuSignClient.GenerateAccessToken. It is indeed related to the changes you mentionned (here : https://github.com/docusign/docusign-esign-csharp-client/commit/bbc7e3df590ff5a961fb3efc239405367d3bc380#diff-ba42f5f1289226fd9b2414cf211518bd5cdd7a81e4d5764fe74fb90ee6b2ada7R91)

I only had to change the contentType of the docusignRequest to add "application/x-www-form-urlencoded" in the GenerateAccesToken implementation.

Looks like so : image

May I open a pull request to bring this fix in the code base ?

Walouh avatar Oct 18 '23 15:10 Walouh

Hi all - the GenerateAcessToken() method should be fixed in the latest 6.8.0 version released today.

kenharris avatar Oct 27 '23 18:10 kenharris