Title: Authentication gets no response
Last modified: August 30, 2016

---

# Authentication gets no response

 *  Resolved [hermes3por3](https://wordpress.org/support/users/hermes3por3/)
 * (@hermes3por3)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/authentication-gets-no-response/)
 * I installed the new version 0.2.6 and attempted to authenticate. Sending the 
   login credentials does not return any response whatsoever.
 * It seems that the problem might come from the remote connections the plugin establishes
   with pinterest website for its business.
 * This is what I have found:
    When Pinim_Bridge class attempts to refresh_token()
   it gets the Pinterest App version by retrieving a response from pinterest.com/
   login with wp_remote_get(). This first remote connection is successful in my 
   case.
 * The second remote connection reads the response from pinterest.com before calling
   the set_auth() method. This is where I got stuck, but to be frank I am not sure
   where the problem comes from. I logged all downloaded blocks to the pinterest.
   com url directly from the request() method of wordpress’ WP_Http_Streams class,
   which is the one being used to establish the connection and found that:
    - Both response headers and body are fully downloaded (the response body finishes
      with a closing </html> tag)
    - For some reason the connection is never closed. Or that’s what it looks like.
      Wether this is a PHP, WordPress, pinterest, plugin issue or my machine’s I
      can’t tell right now. There appears to be no timeout fired (despite http streams’
      being set at 5 sec), or error triggered or exception thrown of any kind.
 * The part where it seems to get stuck is in class-http.php line 1139 where it 
   says:
 *     ```
       while (!feof($handle) && $keep_reading) {
           $block = fread($handle, $block_size);
           $strResponse .= $block;
           if (!$bodyStarted && strpos($strResponse, "\r\n\r\n")) {
               $header_length = strpos($strResponse, "\r\n\r\n") + 4;
               $bodyStarted = true;
           }
           $keep_reading = (!$bodyStarted || !isset($r['limit_response_size']) || strlen($strResponse) < ( $header_length + $r['limit_response_size'] ) );
       }
       ```
   
 * 
    apparently the $handle never gets a feof. Even if at the last execution of 
   this while{} loop you call stream_get_meta_data($handle) you still get the timed_out
   and eof keys as false.
 * That’s as far as I went. My website is run locally in Ubuntu 15.04, PHP Version
   5.6.4-4ubuntu6.3 . It is in a domain called example.com (which is looped back
   to localhost).
 * attempting to log in with WP_DEBUG set to false does the same.
 * [https://wordpress.org/plugins/pinterest-importer/](https://wordpress.org/plugins/pinterest-importer/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [grosbouff](https://wordpress.org/support/users/grosbouff/)
 * (@grosbouff)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/authentication-gets-no-response/#post-6613817)
 * Hi [@hermes3por3](https://wordpress.org/support/users/hermes3por3/);
 * and thanks for this complete report !
    I just did try to backup my pins now and
   everything works fine. Seems that the problem comes from your side.
 * * Is it the first time you try to run the plugin ? If not, already had success
   with it before ?
    * Have you other plugins enabled ? (if yes, please disable 
   them first so we can be sure this is not related to another plugin) * How many
   pins and boards have you got ? * _It is in a domain called example.com_ (which
   is looped back to localhost) what do you mean by this ? But I got no problems
   here running it locally
 *  Thread Starter [hermes3por3](https://wordpress.org/support/users/hermes3por3/)
 * (@hermes3por3)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/authentication-gets-no-response/#post-6614136)
 * Hi, finally I managed to make it work. Well I just **uploaded the website at 
   my production server** and voilà. Flawlessly.
 * Somehow if the website is running at localhost something gets lost somewhere (
   or maybe at any domain which points to 127.0.0.1 as told to the OS by the hosts
   file, which is what I did with _example.com_)
 * Keep up the good work!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Authentication gets no response’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pinterest-importer_fdfdfd.svg)
 * [Pinterest Importer](https://wordpress.org/plugins/pinterest-importer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pinterest-importer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pinterest-importer/)
 * [Active Topics](https://wordpress.org/support/plugin/pinterest-importer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pinterest-importer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pinterest-importer/reviews/)

## Tags

 * [request](https://wordpress.org/support/topic-tag/request/)

 * 2 replies
 * 2 participants
 * Last reply from: [hermes3por3](https://wordpress.org/support/users/hermes3por3/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/authentication-gets-no-response/#post-6614136)
 * Status: resolved