反应Docusign Clickwrap凭证 [英] React Docusign Clickwrap Credentials

查看:83
本文介绍了反应Docusign Clickwrap凭证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的react应用程序中,当我渲染Docusign clickwrap时,我需要提供accountId和clickwrapId.有没有一种安全的方法来引用accountId/clickwrapId而不实际放入这些值.我不想在我的react应用程序中公开这些凭据

In my react application, when Im rendering the Docusign clickwrap, I need to supply the accountId and the clickwrapId. Is there a secure way to reference the accountId/clickwrapId without actually putting those values in. I dont want to expose those credentials in my react application


function App() {
  React.useLayoutEffect(() => {
    docuSignClick.Clickwrap.render({
      environment: 'https://demo.docusign.net',
      accountId: '...',
      clickwrapId: '...',

      onMustAgree(agreement) {
        // Called when no users have previously agreed by the above client user ID for the most recent required Clickwrap version
      },

      onAgreed(agreement) {
        // Called when either 1) the clientUserId has previously agreed 2) the clientUserId has clicked agree and completed successfully
      },

      onDeclined(agreement) {
        // Called when the clientUserId has declined successfully
      }
    }, '#ds-clickwrap');
  }, []);

  return <div id="ds-clickwrap" />
}

推荐答案

啊,如果需要,您可以使用服务器端API生成协议URL.

Ah, you can use the server-side API to generate an agreement URL instead if that is desired.

POST /clickapi/v1/accounts/.../clickwraps/.../协议:只需 clientUserId 即可进行此API调用.您可以从服务器上执行此操作,然后将响应中的URL传递给客户端.

POST /clickapi/v1/accounts/.../clickwraps/.../agreements: Only the clientUserId is required to make this API call. You would do this from your server and then pass the URL from the response to the client.

{
   "clientUserId": "..."
}

这将返回一个协议URL,然后将其用于JS代码段中:

This would return an agreement URL to then be used in the snippet of JS:

{
   ...
   "status": "created",
   "agreementUrl": "https://...."
}

agreementUrl 然后可以在代码段中使用:

This agreementUrl could then be used in the snippet:

docuSignClick.render({
   agreementUrl: '...agreementUrl from REST API response...',

   onAgreed...
}, '#ds-clickwrap');

这篇关于反应Docusign Clickwrap凭证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆