Support » Plugin: FeedWordPress » 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);

    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.

Viewing 1 replies (of 1 total)
  • Please note, this forum messes up the quotes in the code so don’t just copy-paste the code, it needs cleaning up.

    • This reply was modified 11 months, 4 weeks ago by  jmouka.
Viewing 1 replies (of 1 total)
  • The topic ‘basic auth not working on systems not using curl’ is closed to new replies.