DocuSign.eSign.Client.ApiException: "Error while requesting server, received a non successful HTTP code with response Body: {"error":"consent_required"}"
I tried to receive a token with the code below. Unfortunatelly I get the error:
DocuSign.eSign.Client.ApiException
HResult=0x80131500
Nachricht = Error while requesting server, received a non successful HTTP code with response Body: {"error":"consent_required"}
I tried with set TLS 12 and without. We run it in dev mode with base path https://demo.docusign.net/restapi and oAuthBasePath =account-d.docusign.com
Anyone konws what is wrong?
byte[] privateKey=DSHelper.ReadFileContent(DSHelper.PrepareFullPrivateKeyFilePath(privateKeyFilename));
var scopes = new List<string>
{
"signature",
"impersonation",
};
var basePath = ApiClient.Production_REST_BasePath;
var oAuthBasePath = OAuth.Production_OAuth_BasePath;
if (!production)
{
basePath = ApiClient.Demo_REST_BasePath;
oAuthBasePath = OAuth.Demo_OAuth_BasePath;
}
var _apiClient = new ApiClient(basePath);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var authToken = _apiClient.RequestJWTUserToken(
clientId,
ImpersonatedUserId,
oAuthBasePath,
privateKey,
1,
scopes);
I tried to set the consens manually with the URL below. But I receive the (Login Window) the error invalid Authorization: RequestType is not supported.
https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20impersonation&client_id=a5ed47d5-xxxx-xxxx-8a19-756da64391de&redirect_uri=https://www.docusign.com
Is the something wrong with my account Setting?
I found the solution. instead of reponse_type= code I have to use token
The real issue is that you have the client id (integration key) set to Implicit grant. That is not safe from an information security point of view.
Change the client id to NOT use implicit grant.
Then the individual consent API can use response_type=code
We choose Implicit grant we have a SPA App. I read this article.https://developers.docusign.com/platform/auth/. Is Implicit grant not correct for SPA Apps?
Is this issue still relevant?