【问题标题】:Getting Consent For A Console Application获得控制台应用程序的同意
【发布时间】:2021-04-03 01:02:55
【问题描述】:

我正在尝试创建一个控制台程序,该程序从最后一天获取所有 Envelope EmailSubject。

我在同意方面遇到问题,并且不断收到错误消息:

DocuSign.eSign.Client.ApiException: '请求服务器时出错, 收到一个不成功的 HTTP 代码 Completed with response Body: {"error":"consent_required"}'

运行以下代码后我收到此消息:

var apiClient = new ApiClient();
        string ik = _configuration.IntegrationKey;
        string userId = _configuration.UserId;
        string authServer = _configuration.AuthServer;
        string rsaKey = DSHelper.ReadFileContent(DSHelper.PrepareFullPrivateKeyFilePath(_configuration.PrivateKeyFile));
        OAuth.OAuthToken authToken = apiClient.RequestJWTUserToken(ik,
                        userId,
                        authServer,
                        Encoding.UTF8.GetBytes(rsaKey),
                        1);

我了解我需要使用此处的 DocuSign 管理门户步骤“同意内部应用程序”:How to obtain admin consent for internal applications/

但是,即使将我的应用程序添加到连接的应用程序列表后,我仍然会收到“{“error”:“consent_required”}”错误。

任何帮助将不胜感激!

【问题讨论】:

  • 有多少用户会使用这个应用程序? userId 似乎来自配置?是固定的吗?意思是,它永远都是一样的?
  • 类似的问题,可能有助于查看stackoverflow.com/questions/56989496/…
  • @InbarGazit 我试图没有用户。 UserId 实际上是 JSON 配置中的模拟 userId。我正在尝试构建一个每晚运行一次的程序,作为与一些计费软件的集成。我想在没有任何用户登录的情况下调用 API。
  • 那么征得同意就很简单了,你只需要做一次,永远,让我在下面回答。

标签: c# docusignapi


【解决方案1】:

每次特定集成和用户只需要一次同意。 由于您只有一个用户,因此您只需执行一次即可。

在您的 IK 的 Apps and Keys page 中添加 https://www.docusign.com 作为有效重定向后,打开浏览器访问此 URL:

https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20impersonation&client_id=<YOUR_IK>&redirect_uri=https://www.docusign.com

(更新你的 IK)

【讨论】:

  • 非常感谢!
猜你喜欢
  • 1970-01-01
  • 2010-11-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-22
  • 1970-01-01
  • 1970-01-01
  • 2016-08-29
相关资源
最近更新 更多