linux - Authenticate on Wordpress with wget -


i login via wget onto wordpress website.

i have found on stackoverflow related basic authentication.

wget --save-cookies cookies.txt \ --post-data 'user=foo&password=bar' \ http://server.com/auth.php 

and tried wordpress site did not work.

try this. worked me 1 of drupal projects worked on sometime ago. answered asciikewl on drupal thread https://drupal.org/node/118759


i've managed working way, using wget's own cookie handling: i'm referencing /user page, not login block (not enabled on site)

#!/bin/sh site=http://your site url slash on end/ name=scriptuser pass=somethingsecure cookies=/tmp/cron-cookies.txt wget -o /dev/null --save-cookies /tmp/ba-cookies.txt --keep-session-cookies --load-cookies $cookies "${site}user" wget --keep-session-cookies --save-cookies $cookies --load-cookies $cookies -o /dev/null \     --post-data="name=$name&pass=$pass&op=log%20in&form_id=user_login" \     "${site}user?destination=login_redirect" wget --keep-session-cookies --save-cookies $cookies --load-cookies $cookies "${site}login_redirect" 

maybe wget cookie handling can recurse site.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -