Login into a website using wget

0

I can download a file through a URL if I am logged into the website.

https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary%2CAllCampaignsChart%2CAllAds%2CAllCampaignsSites&start_date=9-25-2016&end_date=10-9-2016&format=xlsx&currency=USD

Now, if I try to access that link using wget, it gives me 500 since it does not see me as a logged in user through wget.

I have tried logging in

wget --save-cookies addrollCookied.txt --post-data 'user=userName&password=password' https://app.adroll.com/account/account/signin

And infact tried to load this cookies file while hitting the URL I want to, but wget request is just not treated as a loggedin user.

wget --load-cookies addrollCookied.txt -p  'https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites&format=csv&currency=USD' --debug

Simran kaur

Posted 2016-10-09T16:58:33.050

Reputation:

Answers

0

The authentication parameters for wget are

--user=USERNAME
--password=PASSWORD

You might need to set

--auth-no-challenge

as well.

P.J.Meisch

Posted 2016-10-09T16:58:33.050

Reputation: 126

Your example above is for basic authenticion where the OP appears to be trying to get forms based authention to work.. – HBruijn – 2016-10-09T20:29:23.537