[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SV: Ftpapi Digest, Vol 115, Issue 4



IMHO, you have a number of issues.

You're using a 10 years old version of HTTPAPI. Much has happened since then with the tool.
You're using POST, not GET.
You're specifying that the data load will be in JSON format, yet you're not sending any post data, from what I can see.


If I read the OAuth2 specs correctly, you should do a get and send the request as a parameter.

You should the receive a reply as part of a redirect (it will be appended as an additional parameter). Thus you will have to parse the redirect http header in order to receive your token.

At least that's how I interpret rfc6749, but I'm not an expert and have never used OAuth2.

Ref. https://tools.ietf.org/html/rfc6749


BTW, I hope you realize that you have exposed your login credentials by not removing the Basic authentication key from the debug log.


-----Oprindelig meddelelse-----
Fra: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] På vegne af Shubhadeep Roy
Sendt: 12. maj 2016 22:08
Til: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Emne: Re: Ftpapi Digest, Vol 115, Issue 4

Hi Scott,

Please help me with this issue.

I learnt that the BODY is not necessary to get the OAuth token. I did the following changes- 1. Removed the Body part from the code 2. Changed the Content-Type to 'application/json'

http_setauth is working fine as I can see the Header getting generated correctly for Authorization.

The code is still returning with BAD_REQUEST error. Is there a way to get the complete Request to show in the log somehow? I have the http_debug as ON.

Here's the code and the debug log-

*Code-*
D authUrl         S           1024A   Inz
D authToken       S             24A   Inz

/copy qrpglesrc,httpapi_h
/copy qrpglesrc,errno_h
/include qrpglesrc,yajl_h

D getAuthToken    PR            24A

P getAuthToken    B                   Export
D getAuthToken    PI            24A
 *
D fd              S             10I 0 Inz(3)
D CRLF            C                   X'0d25'
D rc              S             10I 0 Inz
D msg             S            500A   Inz
D runFlag         S               N   Static
D jsonBuf         S          20000A   Varying
 *
D dsLogonDetails  DS                  Static
D  dsAuthUsr                    24A
D  dsAuthPwd                    24A
D  dsAuthUrl                  1024A

 * getLogonInfo Prototype
D getLogonInfo    Pr          1072A
 *
 * Parse Incoming Data from http_url_post_raw
D parseHeader     Pr            10I 0
D                               10I 0 Value
D                                 *   Value
D                               10I 0 Value

 /Free

  http_debug(*ON : '/tmp/ShubhDebugLog.txt');
  Clear authUrl;
  // If not run, set static variables
  If Not runFlag;
     runFlag = *On;
     // Get logon info
     dsLogonDetails = getLogonInfo();
  EndIf;

  http_setauth(HTTP_AUTH_BASIC : dsAuthUsr : dsAuthPwd);
  http_setCCSIDs( 1208: 0 );

  rc = http_url_post_raw( dsAuthUrl
                         :%addr(jsonBuf)
                         :%len(%trimr(jsonBuf))
                         :1
                         :%paddr('PARSEHEADER')
                         :HTTP_TIMEOUT
                         :HTTP_USERAGENT
                         :'application/json' );

  If rc <> 1;
     msg = http_error;
     Clear authToken;
  EndIf;

  Return authToken;

 /End-Free


*Debug Log-*
HTTPAPI Ver 1.17 released 2006-09-23



New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0

http_setauth(): entered

New iconv() objects set, PostRem=1208. PostLoc=0. ProtRem=819. ProtLoc=0

http_persist_open(): entered

http_long_ParseURL(): entered

https_init(): entered

-------------------------------------------------------------------------------------
Dump of local-side certificate information:

-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Dump of server-side certificate information:

-------------------------------------------------------------------------------------
Cert Validation Code = 6000

-----BEGIN CERTIFICATE-----

MIIFQDCCBCigAwIBAgIIGMlF8bmCI9kwDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV

udCsbg==
-----END CERTIFICATE-----
Serial Number: 18:C9:45:F1:B9:82:23:D9
Common Name: *.api.manheim.com
Org: Domain Control Validated
Issuer CN: Go Daddy Secure Certificate Authority - G2 Issuer Country: US Issuer State/Province: Arizona Issuer Locality: Scottsdale Issuer Org: GoDaddy.com, Inc.
Issuer Org Unit: http://certs.godaddy.com/repository/
Unknown Field: 3
Unknown Field: 20150723153240
Unknown Field: 15:32:40 23-07-2015
Unknown Field: 20170723153240
Unknown Field: 15:32:40 23-07-2017
Unknown Field: 1.2.840.113549.1.1.11

Protocol Used: TLS Version 1
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /oauth2/token
Host: integration1.api.manheim.com
User-Agent: http-api/1.17
Content-Type: application/json
Expect: 100-continue
Content-Length: 0
Authorization: Basic c2h2bWFoNXB1dTZ5OGsydGFkNTZ3eWdlOjN3Q0NjZ3VyRzg=


recvresp(): entered
HTTP/1.1 400 BAD_REQUEST
Content-Length: 0
Connection: Close


SetError() #13: HTTP/1.1 400 BAD_REQUEST recvdoc parms: identity 0
header_load_cookies() entered
recvdoc(): entered
SetError() #0:
SetError() #13: HTTP/1.1 400 BAD_REQUEST
http_close(): entered
 ************End of Data********************


On Thu, May 5, 2016 at 1:53 PM, <ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx>
wrote:

> Send Ftpapi mailing list submissions to
>         ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://scottklement.com/mailman/listinfo/ftpapi
> or, via email, send a message with subject or body 'help' to
>         ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
>
> You can reach the person managing the list at
>         ftpapi-owner@xxxxxxxxxxxxxxxxxxxxxx
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Ftpapi digest..."
>
>
> Today's Topics:
>
>    1. Re: Unable to get a successful HTTPAPI response (Shubhadeep Roy)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 5 May 2016 13:53:44 -0400
> From: Shubhadeep Roy <shubhadeep.roy@xxxxxxxxx>
> To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: Unable to get a successful HTTPAPI response
> Message-ID:
>         <CAJu=
> x6-2VdPg8_89yGm676rh37mFVyRaXeD5k6woYW4aX1FOBg@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset="utf-8"
>
> Hi,
>
> We've made some headway. We added my group profile to all the
> directories and the KDB file with full access. I believe the
> authorities have been set correctly now.
>
> What we are getting now is a HTTP 400 (Bad data) error. Pasted below
> is the debug log and a code snippet. I have removed the certificate
> for easier reading.
>
> The following text needs to be part of the raw Body and this is where
> I feel I am doing the mistake.
>
> {
>     "grant_type":"client_credentials"
> }
>
>
> *I have it in my code as follows-*
>  ************Beginning of CODE**************
>
> // Set Authorization
> http_setauth(HTTP_AUTH_BASIC : dsAuthUsr : dsAuthPwd);
>
> data = '{"grant_type":"client_credentials"}';
> size = %len(%trim(data));
> rc = http_url_post_raw(dsAuthUrl : %addr(data) : size :
>                        1 : %paddr('PARSEINCOMING'));
>
> // Parse the Header Data
> http_xproc(HTTP_POINT_PARSE_HEADER : %paddr('READHDR'));
> ************Ending of CODE**************
>
>
>
> NOTE: The Host and Authorization from the log below are correct as
> compared with the Postman application *Debug Log-*
> ************Beginning of data**************
>
> HTTPAPI Ver 1.17 released 2006-09-23
>
>
>
> New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
> ProtLoc=0
>
> http_setauth(): entered
>
> http_persist_open(): entered
>
> http_long_ParseURL(): entered
>
> https_init(): entered
>
>
> ----------------------------------------------------------------------
> --------------- Dump of local-side certificate information:
>
>
> ----------------------------------------------------------------------
> ---------------
>
> ----------------------------------------------------------------------
> --------------- Dump of server-side certificate information:
>
>
> ----------------------------------------------------------------------
> ---------------
> Cert Validation Code = 6000
>
> -----BEGIN CERTIFICATE-----
>
> MIIFQDCCBCigAwIBAgIIGMlF8bmCI9kwDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV
>
> udCsbg==
> -----END CERTIFICATE-----
> Serial Number: 18:C9:45:F1:B9:82:23:D9 Common Name: *.api.manheim.com
> Org: Domain Control Validated
> Issuer CN: Go Daddy Secure Certificate Authority - G2 Issuer Country:
> US Issuer State/Province: Arizona Issuer Locality: Scottsdale Issuer
> Org: GoDaddy.com, Inc.
> Issuer Org Unit: http://certs.godaddy.com/repository/
> Unknown Field: 3
> Unknown Field: 20150723153240
> Unknown Field: 15:32:40 23-07-2015
> Unknown Field: 20170723153240
> Unknown Field: 15:32:40 23-07-2017
> Unknown Field: 1.2.840.113549.1.1.11
>
> Protocol Used: TLS Version 1
> http_persist_post(): entered
> http_long_ParseURL(): entered
> do_post(): entered
> POST /oauth2/token
> *Host: integration1.api.manheim.com <http://integration1.api.manheim.com>
>                                 *
> User-Agent: http-api/1.17
> Content-Type: text/xml
> Expect: 100-continue
> Content-Length: 0
> *Authorization: Basic
> c2h2bWFoNXB1dTZ5OGsydGFkNTZ3eWdlOjN3Q0NjZ3VyRzg=*
>
> recvresp(): entered
> HTTP/1.1 400 BAD_REQUEST
> Content-Length: 0
> Connection: Close
>
> SetError() #13: HTTP/1.1 400 BAD_REQUEST recvdoc parms: identity 0
> header_load_cookies() entered
> recvdoc(): entered
> SetError() #0:
> SetError() #13: HTTP/1.1 400 BAD_REQUEST
> http_close(): entered
>  ************End of Data********************
>
>
> On Tue, May 3, 2016 at 2:21 PM, Shubhadeep Roy <shubhadeep.roy@xxxxxxxxx>
> wrote:
>
> > Hi,
> >
> > I am trying to connect to a TIBCO Mashery endpoint to get an Auth Token
> > with a user name and password provided to me.
> >
> > ?The same request works when I am use Postman application to get the Auth
> > Token with the same credentials. The Auth Token comes in the Header of
> the
> > Post request.
> >
> > I am pasting below the code and httpdebug log.? I am not sure if I am
> > populating the variable "data" correctly. In Postman, this text is sent
> in
> > the Body as can be seen in the embedded image.
> >
> > ?[image: Inline image 1]?
> >
> >
> > *?Code-*
> > P getExtColor     B                   Export
> > D getExtColor     PI            30A
> > D  ppUserID                     24A   Value
> > D  ppPwd                        10A   Value
> > D  ppAuthToken                  24A   Value
> > D  ppVin                        17A   Value
> > D  ppAuthUrl                  1024A   Value
> > D  ppDescUrl                  1024A   Value
> > /Free
> >
> >    http_debug(*ON : '/tmp/ShubhDebugLog.txt');
> >
> >    // Set Authorization
> >    http_setauth(HTTP_AUTH_BASIC : ppUserID : ppPwd);
> >
> >    data = '{"grant_type":"client_credentials"}';
> >    size = %len(%trim(data));
> >    rc = http_url_post_raw(ppAuthUrl : %addr(data) : size :
> >                           1 : %paddr('PARSEINCOMING'));
> >
> >    http_xproc(HTTP_POINT_PARSE_HEADER : %paddr('READHDR'));
> >
> >    If rc <> 1;
> >      msg = http_error;
> >    Else;
> >      ...
> >    EndIf;
> >
> >    Return extColor;
> >
> > /End-Free
> > P getExtColor     E
> >
> > P readHdr         B
> > D readHdr         PI
> > D  headerData                 2048A   const
> >  *
> > D hdrData                     2048A
> >  /Free
> >
> >   hdrData = headerData;
> >
> >  /End-Free
> > P readHdr         E
> >
> >
> >
> > *Debug Log*
> >  ************Beginning of data**************
> >
> > HTTPAPI Ver 1.17 released 2006-09-23
> >
> >
> >
> > New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
> >
> > http_setauth(): entered
> >
> > http_persist_open(): entered
> >
> > http_long_ParseURL(): entered
> >
> > https_init(): entered
> >
> > (GSKit) Access to the key database is not allowed.
> >
> > ssl_error(6003): (GSKit) Access to the key database is not allowed.
> >
> > SetError() #24: gsk_env_init: (GSKit) Access to the key database is not
> > allowed.
> >
> -------------------------------------------------------------------------------------
> >
> > Dump of local-side certificate information:
> >
> >
> -------------------------------------------------------------------------------------
> >
> > (GSKit) An operation which is not valid for the current SSL session state
> > was attempted.
> > ssl_error(5): (GSKit) An operation which is not valid for the current SSL
> > session state was attempted.
> > (GSKit) An operation which is not valid for the current SSL session state
> > was attempted.
> >  ************End of Data********************
> >
> >          ?
> >
> >
> >
> > --
> >
> > Warm regards,
> > Shubh
> > All is well. Everything will be OK!!! - Shubh
> >
>
>
>
> --
>
> Warm regards,
> Shubh
> All is well. Everything will be OK!!! - Shubh
> -------------- next part --------------
>    Hi,
>    We've made some headway. We added my group profile to all the
>    directories and the KDB file with full access. I believe the
>    authorities have been set correctly now.
>    What we are getting now is a HTTP 400 (Bad data) error. Pasted below is
>    the debug log and a code snippet. I have removed the certificate for
>    easier reading.
>    The following text needs to be part of the raw Body and this is where I
>    feel I am doing the mistake.
>
>    {
>
>    ?  ?  "grant_type":"client_credentials"
>
>    }
>
>    I have it in my code as follows-
>    ? ************Beginning of CODE************** ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    // Set Authorization ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?
>    http_setauth(HTTP_AUTH_BASIC : dsAuthUsr : dsAuthPwd); ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ? ?
>    data = '{"grant_type":"client_credentials"}'; ?  ?  ?  ? ?
>    size = %len(%trim(data)); ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ? ?
>    rc = http_url_post_raw(dsAuthUrl : %addr(data) : size :?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? 1 : %paddr('PARSEINCOMING')); ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ? ?
>    // Parse the Header Data ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?
>    http_xproc(HTTP_POINT_PARSE_HEADER : %paddr('READHDR'));
>    ? ************Ending of CODE************** ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    NOTE: The Host and Authorization from the log below are correct as
>    compared with the Postman application
>    Debug Log-
>    ? ************Beginning of data************** ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    HTTPAPI Ver 1.17 released 2006-09-23 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
>    ?  ?  ?  ?  ?  ?  ?
>    http_setauth(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    http_persist_open(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    http_long_ParseURL(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    https_init(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    -----------------------------------------------------------------------
>    --------------
>    Dump of local-side certificate information: ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    -----------------------------------------------------------------------
>    --------------
>    -----------------------------------------------------------------------
>    --------------
>    Dump of server-side certificate information: ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    -----------------------------------------------------------------------
>    --------------
>    Cert Validation Code = 6000 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    -----BEGIN CERTIFICATE----- ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    MIIFQDCCBCigAwIBAgIIGMlF8bmCI9kwDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ? ?
>    udCsbg== ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?
>    -----END CERTIFICATE----- ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ? ?
>    Serial Number: 18:C9:45:F1:B9:82:23:D9 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?
>    Common Name: *.[1]api.manheim.com ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?
>    Org: Domain Control Validated ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ? ?
>    Issuer CN: Go Daddy Secure Certificate Authority - G2 ?  ?  ?  ?  ? ?
>    Issuer Country: US ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?
>    Issuer State/Province: Arizona ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?
>    Issuer Locality: Scottsdale ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ? ?
>    Issuer Org: GoDaddy.com, Inc. ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ? ?
>    Issuer Org Unit: [2]http://certs.godaddy.com/repository/ ?  ?  ?  ?
>    ? ?
>    Unknown Field: 3 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ? ?
>    Unknown Field: 20150723153240 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?
>    Unknown Field: 15:32:40 23-07-2015 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ? ?
>    Unknown Field: 20170723153240 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?
>    Unknown Field: 15:32:40 23-07-2017 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ? ?
>    Unknown Field: 1.2.840.113549.1.1.11 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ? ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    Protocol Used: TLS Version 1 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ? ?
>    http_persist_post(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ? ?
>    http_long_ParseURL(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?
>    do_post(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ? ?
>    POST /oauth2/token ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ? ?
>    Host: [3]integration1.api.manheim.com ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ? ?
>    User-Agent: http-api/1.17 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?
>    Content-Type: text/xml ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ? ?
>    Expect: 100-continue ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ? ?
>    Content-Length: 0 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?
>    Authorization: Basic c2h2bWFoNXB1dTZ5OGsydGFkNTZ3eWdlOjN3Q0NjZ3VyRzg=
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    recvresp(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    HTTP/1.1 400 BAD_REQUEST ?  ?  ?  ?  ?  ?  ?  ?
>    Content-Length: 0 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    Connection: Close ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    SetError() #13: HTTP/1.1 400 BAD_REQUEST
>    recvdoc parms: identity 0 ?  ?  ?  ?  ?  ?  ? ?
>    header_load_cookies() entered ?  ?  ?  ?  ? ?
>    recvdoc(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    SetError() #0: ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    SetError() #13: HTTP/1.1 400 BAD_REQUEST
>    http_close(): entered ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    ? ************End of Data********************
>
>    On Tue, May 3, 2016 at 2:21 PM, Shubhadeep Roy
>    <[4]shubhadeep.roy@xxxxxxxxx> wrote:
>
>    Hi,
>    I am trying to connect to a TIBCO Mashery endpoint to get an Auth Token
>    with a user name and password provided to me.?
>    ?The same request works when I am use Postman application to get the
>    Auth Token with the same credentials. The Auth Token comes in the
>    Header of the Post request.
>    I am pasting below the code and httpdebug log.? I am not sure if I am
>    populating the variable "data" correctly. In Postman, this text is sent
>    in the Body as can be seen in the embedded image.
>    ? Inline image 1 ?
>    ?Code-
>    P getExtColor ?  ?  B ?  ?  ?  ?  ?  ?  ?  ?  ?  Export ?  ?  ?
>    D getExtColor ?  ?  PI ?  ?  ?  ?  ?  ? 30A ?  ?  ?  ?  ?  ?  ? ?
>    D ? ppUserID ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  24A ?  Value ?  ?  ? ?
>    D ? ppPwd ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? 10A ?  Value ?  ?  ? ?
>    D ? ppAuthToken ?  ?  ?  ?  ?  ?  ?  ?  ? 24A ?  Value ?  ?  ? ?
>    D ? ppVin ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? 17A ?  Value ?  ?  ? ?
>    D ? ppAuthUrl ?  ?  ?  ?  ?  ?  ?  ?  ? 1024A ?  Value ?  ?  ? ?
>    D ? ppDescUrl ?  ?  ?  ?  ?  ?  ?  ?  ? 1024A ?  Value ?  ?  ? ?
>    /Free ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ? ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ? ?
>    ?  ? http_debug(*ON : '/tmp/ShubhDebugLog.txt'); ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ? ?
>    ?  ? // Set Authorization ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ? ?
>    ?  ? http_setauth(HTTP_AUTH_BASIC : ppUserID : ppPwd); ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ? ?
>    ?  ? data = '{"grant_type":"client_credentials"}'; ?  ?  ?  ?  ?
>    ?  ? size = %len(%trim(data)); ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?
>    ?  ? rc = http_url_post_raw(ppAuthUrl : %addr(data) : size :
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  1 : %paddr('PARSEINCOMING'));
>    ? ?
>    ?  ? http_xproc(HTTP_POINT_PARSE_HEADER : %paddr('READHDR')); ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ? ?
>    ?  ? If rc <> 1; ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?
>    ?  ?  ? msg = http_error; ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?
>    ?  ? Else; ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?
>    ?  ?  ? ...
>    ?  ? EndIf;
>    ?  ? Return extColor; ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    /End-Free ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    P getExtColor ?  ?  E ?
>    P readHdr ?  ?  ?  ?  B ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    D readHdr ?  ?  ?  ?  PI ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    D ? headerData ?  ?  ?  ?  ?  ?  ?  ?  2048A ?  const
>    ? * ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    D hdrData ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  2048A ?  ?  ?  ?
>    ? /Free ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  hdrData = headerData; ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ? /End-Free ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    P readHdr ?  ?  ?  ?  E ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    Debug Log
>    ? ************Beginning of data************** ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    HTTPAPI Ver 1.17 released 2006-09-23 ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ? ?
>    New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    http_setauth(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    http_persist_open(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    http_long_ParseURL(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    https_init(): entered ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ? ?
>    (GSKit) Access to the key database is not allowed. ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ssl_error(6003): (GSKit) Access to the key database is not allowed. ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    SetError() #24: gsk_env_init: (GSKit) Access to the key database is not
>    allowed. ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    -----------------------------------------------------------------------
>    -------------- ?  ?  ?  ?  ?  ?  ?  ? ?
>    Dump of local-side certificate information: ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?
>    -----------------------------------------------------------------------
>    -------------- ?  ?  ?  ?  ?  ?  ?  ? ?
>    (GSKit) An operation which is not valid for the current SSL session
>    state was attempted. ?  ?  ?  ?  ?  ?  ?
>    ssl_error(5): (GSKit) An operation which is not valid for the current
>    SSL session state was attempted.
>    (GSKit) An operation which is not valid for the current SSL session
>    state was attempted. ?  ?  ?  ?  ?  ?  ?
>    ? ************End of Data******************** ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ? ?  ?  ?
>    ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?  ?
>    ?  ? ?
>    --
>    Warm regards,
>    Shubh
>    All is well. Everything will be OK!!! - Shubh
>
>    --
>    Warm regards,
>    Shubh
>    All is well. Everything will be OK!!! - Shubh
>
> References
>
>    1. http://api.manheim.com/
>    2. http://certs.godaddy.com/repository/
>    3. http://integration1.api.manheim.com/
>    4. mailto:shubhadeep.roy@xxxxxxxxx
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: image.png
> Type: image/png
> Size: 18158 bytes
> Desc: not available
> URL: <
> http://scottklement.com/pipermail/ftpapi/attachments/20160505/b6ff299f/attachment.png
> >
>
> ------------------------------
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list digest.  To unsubscribe, go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
>
> End of Ftpapi Digest, Vol 115, Issue 4
> **************************************
>




______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
--

Warm regards,
Shubh
All is well. Everything will be OK!!! - Shubh

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------