title: Login with Paypal javascript integration
body: <p>I am trying to integrate the new Login with Paypal feature using javascript. I am able to get the button work easily but when I try to get the access token using the authorization code, it does not work and always return: <strong>{"error_description":"client id or secret is null","error":"invalid_client"}</strong>. Based on the error, I know what it the problem, but no matter what I try, it just did not work. </p>
  
  <p>I am able to make it work with the following curl code</p>
  
  <pre><code>curl -v https://api.paypal.com/v1/identity/openidconnect/tokenservice \
  -u "bf4a9e849b21a1feb85f161aaa4f2cea:dfff866aa76de7c6" \
  -d "grant_type=authorization_code&amp;code=6Aam6hMOrHl4v7l...sv16l&amp;redirect_uri=http://somedomain.com/myapp/return.php"
  </code></pre>
  
  <p>Below are one of my post code:</p>
  
  <pre><code>var path = "https://api.paypal.com/v1/identity/openidconnect/tokenservice";
  var code = $("#txtCode").val();
  path = path + "?grant_type=authorization_code&amp;redirect_uri=http://www.example.com&amp;code="+code;
  $.ajax({
      url: path,
      datatype: "json",
      type: "POST",
      headers: {'Authorization': 'Basic urlencoded-base64encoded-client_id-secret'},
      data: JSON.stringify({}),
      success: function(msg){
          alert(msg);
      }
  });
  </code></pre>
  
  <p>Any help or advice is appreciated. </p>
  
  <p>Updated: reference document page:  <a href="https://developer.paypal.com/webapps/developer/docs/api/#grant-token-from-authorization-code" rel="nofollow">https://developer.paypal.com/webapps/developer/docs/api/#grant-token-from-authorization-code</a></p>