【问题标题】:DocuSign JWT Auth Error while requesting server, received a non successful HTTP code Error with response Body C# sdkDocuSign JWT Auth Error while requesting server, received a nonsuccessful HTTP code Error with response Body C# sdk
【发布时间】: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


    【解决方案1】:

    要在演示环境中生成 JWT 令牌,请将您的 oauthBasePath 更改为 account-d.docusign.com(身份验证服务器)。你可以阅读更多herehttps://demo.docusign.net/restapi 是可用于调用所有电子签名端点的应用程序基本路径。

    【讨论】:

      猜你喜欢
      • 2013-10-13
      • 1970-01-01
      • 2022-12-26
      • 1970-01-01
      • 2019-04-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-06
      • 1970-01-01
      相关资源
      最近更新 更多