DocuSign JWT Auth Error while requesting server, received a non successful HTTP code Error with response Body C# sdk
DocuSign JWT Auth Error while requesting server, received a non successful HTTP code Error with response Body C# sdk
我正在尝试将 docusign rest api 集成到我的 .net 版本为 4.7.2 的 Web 应用程序中。我用过5.2.0版本的docusign dll.
我正在尝试使用 jwt 身份验证类型获取访问令牌。所以我为应用程序设置了应用程序、集成商密钥和 rsa 私钥。
var scopes = new List<string>{"impersonation","signature"}
string directorypath = Server.MapPath("~/App_Data/" + "Files/");
string fileNameOnly = "docusign_private_key.txt";
var filePath = Path.Combine(directorypath, fileNameOnly);
var privateKeyBytes = System.IO.File.ReadAllBytes(filePath);
var apiClient = new ApiClient();
var authToken = apiClient.RequestJWTUserToken
(
clientId: credential.ClientID,
userId: credential.UserID,
oauthBasePath: credential.BasePath,
privateKeyBytes: privateKeyBytes,
expiresInHours: 1,
scopes: scopes
);
我使用集成商密钥作为 clientId,API 用户名作为 UserId,https://demo.docusign.net/restapi 作为 oauthBasePath。有什么我忘记提及或弄错的吗?我无法获得访问令牌。它抛出带有消息 Error while requesting server, received a non successful HTTP code Error with response Body
的 ApiException
要在演示环境中生成 JWT 令牌,请将您的 oauthBasePath 更改为 account-d.docusign.com(身份验证服务器)。您可以阅读更多内容 here. https://demo.docusign.net/restapi 是可用于调用所有 eSignature 端点的应用程序基本路径。
我正在尝试将 docusign rest api 集成到我的 .net 版本为 4.7.2 的 Web 应用程序中。我用过5.2.0版本的docusign dll.
我正在尝试使用 jwt 身份验证类型获取访问令牌。所以我为应用程序设置了应用程序、集成商密钥和 rsa 私钥。
var scopes = new List<string>{"impersonation","signature"}
string directorypath = Server.MapPath("~/App_Data/" + "Files/");
string fileNameOnly = "docusign_private_key.txt";
var filePath = Path.Combine(directorypath, fileNameOnly);
var privateKeyBytes = System.IO.File.ReadAllBytes(filePath);
var apiClient = new ApiClient();
var authToken = apiClient.RequestJWTUserToken
(
clientId: credential.ClientID,
userId: credential.UserID,
oauthBasePath: credential.BasePath,
privateKeyBytes: privateKeyBytes,
expiresInHours: 1,
scopes: scopes
);
我使用集成商密钥作为 clientId,API 用户名作为 UserId,https://demo.docusign.net/restapi 作为 oauthBasePath。有什么我忘记提及或弄错的吗?我无法获得访问令牌。它抛出带有消息 Error while requesting server, received a non successful HTTP code Error with response Body
要在演示环境中生成 JWT 令牌,请将您的 oauthBasePath 更改为 account-d.docusign.com(身份验证服务器)。您可以阅读更多内容 here. https://demo.docusign.net/restapi 是可用于调用所有 eSignature 端点的应用程序基本路径。