Five Stars

Why tFetchFile return HTTP error 403

Hi,

I'm looking to download a file from a platform at HTTPS URL. The access requiere authentification. I'm using tFileFetch, but I have systematically HTTP ERROR 403. However I'm sure my login and password are correct because I use them to connect to the web site Https.

Here are screenshots.

I have also the Error 403 using tHttpRequest.

Any suggestion ?

6 REPLIES
Ten Stars

Re: Why tFetchFile return HTTP error 403

HTTP error 403 is an authentication error, so the authentication isn't working right.

 

For the few jobs I run with tFileFetch requiring authentication, I first point at a login URL and provide credentials, saving the resulting cookie.  Then I run a second tFileFetch that references the stored cookie in order to retrieve my file.

 

I also found I was not able to use the authentication fields in Advanced settings.  Instead I had to check POST Method under basic settings and add "user_id" and "password" variables and values to the Parameters box that appears.  To learn the exact variable names needed, I had to use a tool like Fiddler to watch the raw messages being exchanged during a manual retrieval with a web browser.

Five Stars

Re: Why tFetchFile return HTTP error 403

Hi,

Please see this link for the error code you are getting:

 

http://www.restapitutorial.com/httpstatuscodes.html

Five Stars

Re: Why tFetchFile return HTTP error 403

Thanks Ceterenzi,

 

Good idea to catch the variable names for user and password using Fiddler! I've downloaded it, I've retrived the variable names and I've added them into tFileFetch's parameter values, but I still obtain the error 403...

 

There stored cookie contains ("???" for Anonymous) :

optimizelyEndUserId=????????????.???????????????
optimizelySegments=%7B%22198340375%22%3A%22direct%22%2C%22198416283%22%3A%22none%22%2C%22198418477%22%3A%22edge%22%2C%22198472144%22%3A%22false%22%7D
optimizelyBuckets=%7B%7D
EmeaADPLangLocaleCookie=fr-FR
SMCHALLENGE=YES

 

For more information:

 

I can download a file using this script CURL ("???", user and pwd for Anonymous data) : 

Curl --INSECURE --Location -v -f -s --show-error --stderr "D:\Log\curl.log" -b "SMCHALLENGE=YES" –U "My_Login:My_password" –x "192.???.?.?:8080 " -u "user1:user1pwd" -o "D:\Recu\test.txt" "https://www.???.com/dock/test.txt"

 

When I connect correctly with IE, authorization informations catched using Fiddler are ("???", user and pwd for Anonymous data): 

No Proxy-Authorization Header is present.

Authorization Header is present: Basic ??????????????????????

Decoded Username : Password= user1 : user1pwd

 

Something interesting: when I add a header having name "Authorization", the warning message disappears! But there is still the error 403 ("Authorization" value is "Basic user1:user1pwd")

Five Stars

Re: Why tFetchFile return HTTP error 403

Hi,

 

Any suggestion ? Maybe some parameters are missing (realm, scheme name, keep-alive, content-type...) ?

I'm still trying all I can without success

 

Tanks

Five Stars

Re: Why tFetchFile return HTTP error 403

Hi,

 

I had a similar issue. The tfileFetch component only returns the header and not the response body. The response body is what consists of the cause for the error you are getting.

Try using the component from here:

https://exchange.talend.com/#marketplaceproductoverview:marketplace=marketplace%252F1&p=marketplace%...

Five Stars

Re: Why tFetchFile return HTTP error 403

Thanks for the information sindu_, but I've tried tUploadFileReturnResponseBody and I'm getting the standard response body for a HTTP 403 error...

<title>Error</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">

</head><body>

<hr>
<h1><strong>An error has occurred</strong></h1>
<strong><em>Please contact your service manager.</em></strong>

I'm still stuck...