basic auth not working on systems not using curl
-
The basic authentication header is not being set correctly when on platforms that don’t use curl to fetch the requests. I fixed it by editing feedwordpress_file.class.php, lines 57-60, replace
$args[‘authentication’] = $source->authentication_method();
$args[‘username’] = $source->username();
$args[‘password’] = $source->password();with (correct way to create basic auth header)
if($source->authentication_method()==’basic’) :
$credentials = $source->username() . ‘:’ . $source->password();
$args[‘headers’][‘authorization’] = ‘Basic ‘ . base64_encode($credentials);
endif;and I comment out in feedwordpresshttpauthenticator.class.php lines 56-82 (the entire case ‘basic’ block).
I can’t guarantee that this won’t break something else, but I don’t believe so. The method of encoding the username/password into http://user@password:… is not actually valid. It works on some systems because the library that does the fetch creates the correct http header, eg curl does this.
The topic ‘basic auth not working on systems not using curl’ is closed to new replies.