Dear Gustaf,
It did help me to remind and review my own code to assure that it was properly
written. I grabbed the code from
https://naviserver.sourceforge.io/n/naviserver/files/ns_http.html#5
<https://naviserver.sourceforge.io/n/naviserver/files/ns_http.html#5>
Plus, I switched to ns_base40encode. Before I was using Openacs [base64::encode
“${client}:${secret}"]
I've used the very first, basic and simple example (i.e. http queue and http
wait), and still, I get the same logs.
https://evex.co/paypal-checkout <https://evex.co/paypal-checkout>
Notice: HTTP
status 0 time 0:215139 headers d5 body {} https {sslversion TLSv1.2 cipher
AES256-SHA256}
I’m able to change credentials whenever I want to get 400 error to return. That
means the credentials passed in the header were properly assigned.
Even though I agree I need to talk to the guys on PayPal, in case I missed any
parameter to allow connectivity on their side.
Notice: HttpTaskRecv: connection probably closed by server (url
https://api.sandbox.paypal.com/v1/oauth2/token
<https://api.sandbox.paypal.com/v1/oauth2/token>)
Best wishes,
I
[16/Nov/2019:15:36:11][450.7f7a87fff700][-conn:evex:124:46257-] Warning:
/paypal-checkout has no doc(title) set, fallback to instance_name.
[16/Nov/2019:15:36:23][450.7f7a87fff700][-conn:evex:124:46259-] Notice:
HttpTaskRecv: connection probably closed by server (url
https://api.sandbox.paypal.com/v1/oauth2/token
<https://api.sandbox.paypal.com/v1/oauth2/token>)
[16/Nov/2019:15:46:05][450.7f7a87fff700][-conn:evex:124:46273-] Notice:
HttpTaskRecv: connection probably closed by server (url
https://api.sandbox.paypal.com/v1/oauth2/token
<https://api.sandbox.paypal.com/v1/oauth2/token>)
[16/Nov/2019:15:46:05][450.7f7a87fff700][-conn:evex:124:46273-] Notice: RETURN
URL /paypal-checkout *******
> On Nov 16, 2019, at 15:47, Iuri Sampaio <[email protected]> wrote:
>
> Dear Gustaf,
> It did help me to remind and review my own code to assure that it was
> properly written. I grabbed the code from
> https://naviserver.sourceforge.io/n/naviserver/files/ns_http.html#5
> <https://naviserver.sourceforge.io/n/naviserver/files/ns_http.html#5>
> Plus, I switched to ns_base40encode. Before I was using Openacs
> [base64::encode “${client}:${secret}"]
> I've used the very first, basic and simple example (i.e. http queue and http
> wait), and still, I get the same logs.
> https://evex.co/paypal-checkout <https://evex.co/paypal-checkout>
>
>
> Notice: HTTP
> status 0 time 0:215139 headers d5 body {} https {sslversion TLSv1.2 cipher
> AES256-SHA256}
>
>
> Notice: HttpTaskRecv: connection probably closed by server (url
> https://api.sandbox.paypal.com/v1/oauth2/token
> <https://api.sandbox.paypal.com/v1/oauth2/token>)
>
>
> I’m able to change credentials whenever I want to get 400 error to return.
> That means the credentials passed in the header were properly assigned.
> Even though I agree I need to talk to the guys on PayPal, in case I missed
> any parameter to allow connectivity on their side.
>
>
> Best wishes,
> I
> [16/Nov/2019:15:36:11][450.7f7a87fff700][-conn:evex:124:46257-] Warning:
> /paypal-checkout has no doc(title) set, fallback to instance_name.
> [16/Nov/2019:15:36:23][450.7f7a87fff700][-conn:evex:124:46259-] Notice:
> HttpTaskRecv: connection probably closed by server (url
> https://api.sandbox.paypal.com/v1/oauth2/token
> <https://api.sandbox.paypal.com/v1/oauth2/token>)
>
>
>
>
> [16/Nov/2019:15:46:05][450.7f7a87fff700][-conn:evex:124:46273-] Notice:
> HttpTaskRecv: connection probably closed by server (url
> https://api.sandbox.paypal.com/v1/oauth2/token
> <https://api.sandbox.paypal.com/v1/oauth2/token>)
> [16/Nov/2019:15:46:05][450.7f7a87fff700][-conn:evex:124:46273-] Notice:
> RETURN URL /paypal-checkout *******
>
>
>
>
>> On Nov 16, 2019, at 08:58, Gustaf Neumann <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> Dear Iuri,
>>
>> Let's start with a simple example: make a GET request to a service, which
>> requires basic authentication
>> % ns_http run https://jigsaw.w3.org/HTTP/Basic/
>> <https://jigsaw.w3.org/HTTP/Basic/>
>> status 401 time 0:513863 headers d11 body {<!DOCTYPE HTML PUBLIC
>> "-//W3C//DTD HTML 4.01 Transitional//EN"
>> "http://www.w3.org/TR/html4/loose.dtd"
>> <http://www.w3.org/TR/html4/loose.dtd>>
>> <html>
>> <head>
>> ...
>>
>> NaviServer returns (starting with 4.99.17) for "ns_http run" a Tcl dict with
>> the relevant information. The request above returns the HTTP status
>> code 401, which means "Unauthorized".
>>
>> Ok, now add some Authorization. As defined by RFC 7617, one has to add an
>> Authorization request header field with user:id:password encoded in base64.
>> % set h [ns_set create]
>> % ns_set update $h Authorization "Basic [ns_base64encode guest:guest]"
>> % ns_http run -headers $h https://jigsaw.w3.org/HTTP/Basic/
>> <https://jigsaw.w3.org/HTTP/Basic/>
>> status 200 time 0:485802 headers d8 body {<!DOCTYPE HTML PUBLIC
>> "-//IETF//DTD HTML//EN">
>> <html>
>> <head>
>> ...
>>
>> Now we see the status code 200, which means that the Authentication was ok.
>> If you still get a status code of 401, probably userid and/or password are
>> not ok.
>>
>> Hope this helps.
>> -gn
>>
>> On 15.11.19 16:21, Iuri Sampaio wrote:
>>> What would be the argument/switch to convert the option -u, from CURL
>>> command, to ns_http command?
>>>
>>> curl -v https://myhost.com/oauth2/token <https://myhost.com/oauth2/token> \
>>> -H "Accept: application/json" \
>>> -H "Accept-Language: en_US" \
>>> -u "client_id:secret" \
>>> -d "grant_type=client_credentials"
>>
>> _______________________________________________
>> naviserver-devel mailing list
>> [email protected]
>> <mailto:[email protected]>
>> https://lists.sourceforge.net/lists/listinfo/naviserver-devel
>
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel