Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Using HTTP Post on website that needs Cookie
Topic Summary: How do I authenticate?
Created On: 09/28/2011 05:42 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 09/28/2011 05:42 AM
User is offline View Users Profile Print this message

Author Icon
StephenShaffer
n00b (>6 posts)

Posts: 5
Joined: 04/25/2011

Good Morning,

I am looking to do a HTTP Post on a website and scaping the result.

Under my normal manual procedure, I log into this website thought a form based username and password screen, which sets a cookie, and then I can proceed to do the post at a particular URL. 

However, when using Automate and the HTTP automation, the result I get is "Not Authotized", which is the website telling me that (a) I am not logged in and / or (b) it can't find the cookie.

How can I set a cookie in the correct location for Automate to see it during an HTTP Post task?  Or how do I tell Automate to consumer a particular cookie prior to my HTTP Post task?

When using the Web Browser automation (Internet Explorer option) it is clear that Automate is using the normal  ..\Microsoft\Windows\Temporary Internet Files folder for cookies.  However the Web Browesr (versus the HTTP automation) will not work for my needs. 

Thanks,

Steve



 Category Survey
 09/28/2011 02:46 PM
User is offline View Users Profile Print this message

Author Icon
Liz Casale
AUTOMATE EMPLOYEE

Posts: 940
Joined: 05/23/2011

Hi Steve,

Thank you for your post. Would you be able to attach the task or copy/paste the HTTP Post step in this post so we can see the step.

 Category Survey


-------------------------
Liz Casale
Technical Support Representative
(213) 738-6966
Network Automation, Inc.

--------------------------------------------------------------------------------

AM5 5.5.5.1; AM6 6.2.8.0; AM7 7.1.3.0; AM8 8.0.9.0; AM9 9.0.3.4
BPA7 7.1.3.0; BPA8 8.0.9.0; BPA9 9.0.3.4
 10/31/2012 11:24 AM
User is offline View Users Profile Print this message

Author Icon
AndrewMorgan
Student (5-19 posts)

Posts: 9
Joined: 06/17/2010

I am having the same issue - this is my first time using the HTTP function, so I need some assistance on how to make this work. I have attached an example of what I am trying to accomplish.

I would like to login to our back office and then pull the html from the login page.

 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 11/01/2012 08:16 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Andrew,

Would it be possible to setup a GoToAssist session where we can take a closer look at this issue? If this is possible please send an email over to support@networkautomation.com with a list of your availability.

Note: Please reference this forum thread in your email.


 Category Survey
AutoMate 8 version:
Windows version:


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 08/13/2013 06:29 PM
User is offline View Users Profile Print this message

Author Icon
AdrianAcuna
Journeyman (50-99)

Posts: 94
Joined: 05/29/2010

I'm doing something similar here, but the server I'm going to requires that I post to "https://sub.site.com/account/login.htm". However, When I test the POST action, AM8 POSTs to "/account/login.htm". The remote server does not allow this and prompts the agent to redirect to "https://sub.site.com" instead.... How do I force AM8 to post to an explicit URL?

 Category Survey
AutoMate 8 version:
Windows version:


-------------------------
Adrian Acuña
Sales Engineer
 08/14/2013 09:00 AM
User is offline View Users Profile Print this message

Author Icon
AdrianAcuna
Journeyman (50-99)

Posts: 94
Joined: 05/29/2010

NM, it looks like what comes out of the dataset.Header is not actually what is going out. However, I did notice that even with "allow" cookies, it never seems to write to my cookie file, even though I can see the "set-cookie" response in the response header in Fiddler.

Here's what AM8 sends...


POST https://scottgs.demo.vm:443/EFTClient/Account/Login.htm HTTP/1.1
Host: scottgs.demo.vm:443
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)
Accept-Encoding: gzip, deflate
Connection: Close
Content-Length: 27

username=test&password=test



Here's the response from the server.


HTTP/1.1 302 Moved Temporarily
Date: Wed, 14 Aug 2013 15:47:47 GMT
Location: https://scottgs.demo.vm/
Content-Type: text/html; charset=utf-8
Content-Length: 501
Set-Cookie: switchtoptc=true; expires=Thursday, 14-Aug-14 15:47:47 GMT; path=/; secure
Set-Cookie: websessionid=3C0F19A859D9ABECB66F9F52399D956E537EF1EA1AFA7A6CABE7F02CD57D4708; path=/; secure; HttpOnly
Set-Cookie: savedpath=xxxxxx; expires=Tuesday, 14-Aug-12 15:47:47 GMT; path=/; secure
Cache-control: no-cache, no-store
Pragma: no-cache
Connection: close
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block

Redirect

The page must be viewed over a secure channel

The page you are trying to access is secured with Secure Sockets Layer (SSL).

You will be automatically redirected to an SSL-enabled version of this website.

Click here if you are not automatically redirected.



??????



 Category Survey
AutoMate 8 version:
Windows version:


-------------------------
Adrian Acuña
Sales Engineer
 08/20/2013 09:59 AM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Adrian,

Would it be possible to provide a reproducible case (task) we can run here?

 Category Survey
AutoMate 8 version:
Windows version:


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 2047 guests browsing this forum, which makes a total of 2047 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog