【发布时间】:2021-02-01 08:15:20
【问题描述】:
我正在尝试将 docusign rest api 集成到我的 .net 版本为 4.7.2 的 Web 应用程序中。我使用的是 5.2.0 版本的docusign dll。
我正在尝试使用 jwt auth 类型获取访问令牌。所以我为app设置了app、integrator key和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@
【问题讨论】:
标签: c# asp.net-mvc docusignapi