无法登录Docusign [英] Unable to login in Docusign

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

问题描述

$(document).ready(function () {
debugger;
$.ajax({
        type: "GET",
        headers: {
        "Accept" : "application/json",
        "Content-Type": "application/json"
        },
        beforeSend: function (request) {
        // request.setRequestHeader("X-DocuSign-Authentication"
        // , "<DocuSignCredentials><Username>*******</Username><Password>****** </Password>    <IntegratorKey>******</IntegratorKey></DocuSignCredentials>");
        request.setRequestHeader("X-DocuSign-Authentication"
        ,"{\"Username\":\"********\",\"Password\":\"*****\",\"IntegratorKey\":\"*******\"}");
        },
        url: "https://demo.docusign.net/restapi/v2/login_information?    api_password=false&include_account_id_guid=tr...
        success: function (r) {
            debugger;
        },
        error: function (xhr) {
          alert(xhr.responseText);
        }
    });
});

我在上面使用登录名,得到响应代码200。但是响应始终为空。即使如果我输入了错误的密码,仍然可以输入200。
此外,在API部分的激活下,部分为空白。.请建议解决方案

I am using above to login, I get response code 200.. But response is always blank .Even if I give wrong password, still it gives 200. Moreover Under API section Activate In part is blank.. Please suggest solution

推荐答案

错误请求资源中没有'Access-Control-Allow-Origin'标头指示DocuSign无法通过jQuery / AJAX访问。您将要通过另一种语言发出登录请求,并将变量传递给JS

The error No 'Access-Control-Allow-Origin' header is present on the requested resource indicates that DocuSign is not accessable through jQuery/AJAX. You're going to want to do your login request through another language and pass the variables through to JS

以下是我在上文中提供的答案的更多详细信息PHP。

这是一个简单的示例,我刚刚提出来说明应该完成的过程,必须对其进行修改以满足您的需求(

This was a quick example I just threw together to show the process that should be done, it will have to be modified to fit your needs (especially if you're not using PHP).

<div id='divBox'>Logging into DocuSign...</div>
<script src="js/jQuery2.1.1.js"></script>
<script>
$(function (){
  $.ajax({
    type: "GET",
    url: "script.php",
    dataType: "json",
    success: function( data ){
      if(!data.errorCode)
      {
        $('#divBox').html('Logged Into ' + data.name + ' (' + data.accountId + ') account!');
      }else{
        $('#divBox').html('Failed to Login!<br>Error: ' + data.errorCode);
      }
    },
    error: function(){
      alert("error");
    }
  });
});
</script>



Script.php:



Script.php:

<?
$email = "ENTER EMAIL HERE";
$password = "ENTER PASSWORD HERE";
$integratorKey = "ENTER INTEGRATOR KEY HERE";

$url = "https://demo.docusign.net/restapi/v2/login_information?include_account_id_guid=true";
$header = "<DocuSignCredentials><Username>" . $email . "</Username><Password>" . $password . "</Password><IntegratorKey>" . $integratorKey . "</IntegratorKey></DocuSignCredentials>";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("X-DocuSign-Authentication: $header"));
$json_response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

if($status==200){
  $response = json_decode($json_response, true);
  print_r(json_encode($response['loginAccounts'][0]));
}else{
  print_r($json_response);
}

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

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