使用JWT获取访问令牌后,canteral_authentication_fail_fail


  1. 我正在尝试在应用程序和DocuSign Sandbox之间建立连接。

  2. 我使用JWT授权。

  3. 我与生成RSA私钥的集成密钥。
  4. 我有用户与GUID和同意Aquired
  5. 模仿
  6. 我致电https://account-d.docusign.com/oauth/token,并带有适当的数据,这些数据响应成功,并让我返回访问令牌

直到这一刻,一切都很好。

我已经下载了php" docusign/esign-client"的库

并使用了代码的片段:

        $recipientId = uniqid(5);
        $clientUserId =  uniqid(5);
        $document = new Document([
            'document_base64' => $base64FileContent,
            'name' => 'Application Form',
            'file_extension' => 'pdf',
            'document_id' => '1'
        ]);
        $signer = new Signer([
            'email' => $email,
            'name' => $name,
            'recipient_id' => $recipientId,
            'routing_order' => "1",
            'client_user_id' => $clientUserId,
        ]);
        $signHere = new SignHere([
            'document_id' => '1', 'page_number' => '3', 'recipient_id' => $recipientId,
            'tab_label' => 'SignHereTab', 'x_position' => '195', 'y_position' => '147'
        ]);
        $signer->setTabs(new Tabs(['sign_here_tabs' => [$signHere]]));
        $envelopeDefinition = new EnvelopeDefinition([
            'email_subject' => "Please sign this document",
            'documents' => [$document],
            'recipients' => new Recipients(['signers' => [$signer]]),
            'status' => "sent"
        ]);
        $config = new Configuration();
        $config->setHost('https://demo.docusign.net/restapi');
        $config->addDefaultHeader("Authorization", "Bearer " . $accessToken);
        $config->setAccessToken($accessToken);
        $apiClient = new ApiClient($config);
        $envelopeApi = new EnvelopesApi($apiClient);
        $results = $envelopeApi->createEnvelope($integrationKey, $envelopeDefinition);  

结果是一个错误(400(来自API,其中包含信息:

PARTNER_AUTHENTICATION_FAILED
The specified Integrator Key was not found or is disabled. Invalid account specified for user.

它说集成密钥是错误的,但是在我使用此集成密钥来生成访问令牌之前很少。

您有什么想法是什么问题?

在JWT集成之前,我使用了来自Oauth代币生成器的不同集成密钥和访问令牌,并且它运行良好(此先前密钥没有生成RSA(

你们能帮我解决这个问题吗?

如果更多的信息可以帮助找到解决方案,请告诉我,我将更新我的帖子。

感谢您的帮助。

问题在此行中

 $results = $envelopeApi->createEnvelope($integrationKey, $envelopeDefinition);

Createenvelope方法的第一个参数应该是帐户ID,而不是Integrator密钥。

收到访问令牌后,您可以进行UserInfo调用并从中取出帐户ID。

最新更新