Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-4237

FIWARE.Request.Tech.Security.IDM-KeyRock.WP-OAuth user authentication PHP CURL

    Details

      Description

      Created in FIWARE Q/A platform on 09-06-2015 at 21:06
      Answer this issue at http://stackoverflow.com/questions/30741118/fiware-wp-oauth-user-authentication-php-curl

      Question:
      FiWare WP-OAuth user authentication PHP CURL
      Description:
      I am using KeyRock from FiWare.org. Previously everything seems to work find but now the rest server after user authorization send me the following response. I have looked at the server response and it seems to be a NULL/Empty response. But on the NodeJS the request is processed seamlessly. I am using wp-oauth plugin and have modified it to work with FiWare. I am sending this request via PHP CURL.

      {
      "error":

      { "message": "Expecting to find application/json in Content-Type header - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.", "code": 400, "title": "Bad Request" }

      }

      Following is the CURL request I am using:

      $url = URL_TOKEN . $url_params;
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, $url);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
      curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
      curl_setopt($curl, CURLOPT_USERPWD, CLIENT_ID . ":" . CLIENT_SECRET);
      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, (get_option('wpoa_http_util_verify_ssl') == 1 ? 1 : 0));
      curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, (get_option('wpoa_http_util_verify_ssl') == 1 ? 2 : 0));
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result = curl_exec($curl);

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            aalonsog Alvaro Alonso
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: