I can't start any migration. I can't login though url, username and password are correct.
The only line I see in my server log is this (in Drupal log there is nothing):

[21/Mar/2014:17:34:12 +0100] "GET /wp-login.php HTTP/1.0" 200 868 "-" "-"
[21/Mar/2014:17:34:13 +0100] "POST /wp-login.php HTTP/1.1" 200 3873 "-" "Importer"

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mkhamash’s picture

I think the problem lies with the testcookie post variable in method sourceDataFormValidate, I don't know why it is there but my guess it is legacy from an old wordpress behavior.

The problem is that we are sending a post request with username+password+testcookie, without requesting wp-login.php before which sends us Set-Cookie:wordpress_test_cookie=WP+Cookie+check;

I think removing testcookie form the post veriables that are sent shouldn't be a problem as the WordPress validation will skip the cookie validation if we didn't send testcookie :

	// If cookies are disabled we can't log in even with a valid user+pass
	if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
		$user = new WP_Error('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
	else
		$user = wp_signon('', $secure_cookie);
mkhamash’s picture

Assigned: Unassigned » mkhamash
Category: Support request » Bug report
giuvax’s picture

YEAH.
Patch is working fine. Testcookie was the problem.
Thanks a lot!

Giulia

mkhamash’s picture

Status: Active » Needs review
docans’s picture

Hi

I am having the same problem yet the patch does not work anymore.

mikeryan’s picture

Version: 7.x-2.3-beta1 » 7.x-2.x-dev
Assigned: mkhamash » mikeryan
Status: Needs review » Needs work

Yup, doesn't work as-is, or with this patch (testing with a www.wordpress.com site). Presumably the login form has changed, researching.

mikeryan’s picture

Response from wordpress.com is

HTTP/1.1 403 Forbidden
Server: nginx
Date: Thu, 09 Oct 2014 15:38:13 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive

Probably they're enforcing form submissions coming from their own site only, which is (belatedly) security-prudent.

I'll update my old local install of Wordpress and see if they're doing anything in the code itself to prevent this working. It is just possible that this feature (which was always a little hackish) might need to be dropped, and you'll need to obtain the export yourself and upload it.

mikeryan’s picture

Status: Needs work » Needs review
FileSize
1.53 KB

OK, WordPress is now using yet another login cookie name, so I've added a check for that - it works with a local WordPress installation. As for wordpress.com, I tried setting a "real" user agent string on the request but nginx still blocks us, so I've added a note that this will not work. Please try out this patch - if you have any trouble, please be sure to include your WordPress version (this has been tested with 3.9.2 and 4.0).

  • mikeryan committed f48eab9 on 7.x-2.x
    Issue #2223229 by mikeryan: Update to handle newer login cookies
    
mikeryan’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.