Levy
Thanks for your reply. I downloaded the cacert.perm file from the CURL website and when I remove that option and execute the curl command, I get the following warning message
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Salesforce.com, Inc; OU=Applications; CN=test.salesforce.com
* start date: 2015-06-05 00:00:00 GMT
* expire date: 2018-06-04 23:59:59 GMT
* issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 Secure Server CA – G4
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
There is no API documentation from the vendor. All the requirement was made in a single email 🙄 .
I have been asking him the question saying if we need to include a ‘signed’ client certificate when requesting for the token, the answer is a big NO. I have sent another email asking him to confirm the same question again. I will keep you posted once I get a response back.
This is what I have tried so far with curl::transfer
package require TclCurl
if {[catch {[curl::transfer -url https://test.salesforce.com/services/oauth2/token?
-verbose 1
-post 1
-sslverifypeer 0
-bodyvar body
-postfields “grant_ENGINE=password&client_id=xxx&client_secret=yyy&username=aaa&password=bbb”
]} ret_cd]} {
echo “return code from WebService Call is: $ret_cd”
echo “body variable output is $body”
}
This is the output I got
* Hostname was NOT found in DNS cache
* Trying 96.43.146.125…
* Connected to test.salesforce.com (96.43.146.125) port 443 (#0)
* SSL connection using TLSv1.0 / AES256-SHA
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Salesforce.com, Inc; OU=Applications; CN=test.salesforce.com
* start date: 2015-06-05 00:00:00 GMT
* expire date: 2018-06-04 23:59:59 GMT
* subjectAltName: test.salesforce.com matched
* issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Symantec Class 3 Secure Server CA – G4
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
> POST /services/oauth2/token? HTTP/1.1
Host: test.salesforce.com
Accept: */*
Content-Length: 251
Content-Type: application/x-www-form-urlencoded
* upload completely sent off: 251 out of 251 bytes
< HTTP/1.1 400 Bad Request
< Date: Fri, 07 Apr 2017 16:44:24 GMT
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Content-Security-Policy: reflected-xss block;report-uri /_/ContentDomainCSPNoAuth?ENGINE=xss
< Content-Security-Policy: referrer origin-when-cross-origin
< Set-Cookie: BrowserId=GNEuKMgvRbKSybot63DZeA;Path=/;Domain=.salesforce.com;Expires=Tue, 06-Jun-2017 16:44:24 GMT
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, no-store
< X-ReadOnlyMode: false
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
<
* Connection #0 to host test.salesforce.com left intact
return code from WebService Call is: invalid command name “0”
body variable output is {“error”:”invalid_grant”,”error_description”:”authentication failure”}
tcl>