Question

HTTPCaller Authentication

  • 16 September 2016
  • 14 replies
  • 18 views

Badge

Hi,

I have been tackling an issue trying to access HTML page where login is required. So what I basically did was to add the login credentials to the Multipart Upload as follow:

NameTypeValueloginStringUploadpasswordStringUpload

Request URL: http://pvoutput.org/login.jsp

HTTP Method: POST

And then I got to save the cookies, in order to access the webpage and save the authentication

HTTP Client Options:

Save Cookies: Yes

Unfortunately this doesn't work and doesn't authenticate or allow accessing the page. It would be really of great help if somebody know how can this be done? If this is not clear enough, please just ask!

Thanks a lot!


14 replies

Badge

This how the login page source code looks like:

authenticationresponsetext.txt

In line 36 & 37:

<input type="text" name="login" id="login" size="30" style='font-size:14px;color:#252525' value=''/>

<input type="password" name="password" id="password" size="20" style='font-size:14px;color:#525252' />

This where I need to insert the user name and password.

Userlevel 2
Badge +17

Hi @fouly, I think the request URL was wrong. The post request should be sent to the URL that is specified as the "action" attribute in the "form" tag.

<form action="index.jsp" method="post">
Userlevel 2
Badge +17

Hi @fouly, I think the request URL was wrong. The post request should be sent to the URL that is specified as the "action" attribute in the "form" tag.

<form action="index.jsp" method="post">
Forgot. To get the cookie, you will have to access the login page with GET method with the first HTTPCaller. Then, send the POST request to the index page with the second HTTPCaller..

 

 

Badge
Forgot. To get the cookie, you will have to access the login page with GET method with the first HTTPCaller. Then, send the POST request to the index page with the second HTTPCaller..

 

 

I added index.jsp to the HTTPCaller as follow:

 

But this didn't seem to work either. Still, authentication was not executed as expected.
Badge
I added index.jsp to the HTTPCaller as follow:

 

But this didn't seem to work either. Still, authentication was not executed as expected.
As for getting the cookies, I also tried to access the login page with GET method with the first HTTPCaller as you mentioned above.

But it doesn't seem to work as well
Userlevel 2
Badge +17
As for getting the cookies, I also tried to access the login page with GET method with the first HTTPCaller as you mentioned above.

But it doesn't seem to work as well
Hi @fouly, is the login page URL for the first HTTPCaller correct?

 

Userlevel 2
Badge +17
As for getting the cookies, I also tried to access the login page with GET method with the first HTTPCaller as you mentioned above.

But it doesn't seem to work as well
@fouly, I was able to access the login page with the URL shown in your screenshot, so it was correct.

 

The input feature was output from the <Rejected> port? If so, make sure what the error message says. Otherwise, check whether the response body contains required contents.
Badge

I can also access the login page but authentication doesn't work as expected. The response body doesn't contain the required contents.

If authentication works as expected, then the HTTPCaller 'http://pvoutput.org/intraday.jsp?id=38342&sid;=35087&dt;=20160901' afterwards should function correctly. The latter url should work only if you're successfully logged in.

Userlevel 2
Badge +17

I can also access the login page but authentication doesn't work as expected. The response body doesn't contain the required contents.

If authentication works as expected, then the HTTPCaller 'http://pvoutput.org/intraday.jsp?id=38342&sid;=35087&dt;=20160901' afterwards should function correctly. The latter url should work only if you're successfully logged in.

hmm, what does the feature output from the second HTTPCaller contain as its response body or error message?

 

Also make sure that the "Save Cookies" parameter is set to "Yes" for every HTTPCaller.

 

Badge

I can also access the login page but authentication doesn't work as expected. The response body doesn't contain the required contents.

If authentication works as expected, then the HTTPCaller 'http://pvoutput.org/intraday.jsp?id=38342&sid;=35087&dt;=20160901' afterwards should function correctly. The latter url should work only if you're successfully logged in.

It contains the html page of the login page still. Because logging in or authentication isn't done yet.

And yes, 'Save Cookies' parameter is set to 'Yes' for every HTTPCaller

Userlevel 2
Badge +17

I can also access the login page but authentication doesn't work as expected. The response body doesn't contain the required contents.

If authentication works as expected, then the HTTPCaller 'http://pvoutput.org/intraday.jsp?id=38342&sid;=35087&dt;=20160901' afterwards should function correctly. The latter url should work only if you're successfully logged in.

It might work if you pass the login and password as the "Query String Parameters"

 

Badge
It might work if you pass the login and password as the "Query String Parameters"

 

 

I tried it on the browser and it worked, but again, it didn't seem to work in fme.

 

I don't get an error, but simply the authentication isn't done properly.

 

 

Userlevel 2
Badge +17

I can also access the login page but authentication doesn't work as expected. The response body doesn't contain the required contents.

If authentication works as expected, then the HTTPCaller 'http://pvoutput.org/intraday.jsp?id=38342&sid;=35087&dt;=20160901' afterwards should function correctly. The latter url should work only if you're successfully logged in.

Did you try this?

Badge
Did you try this?

Yes, this is what I had in the first place.

 

Response Body Encoding: System Default (fme-system)

Reply