[ https://jira.fiware.org/browse/HELP-9252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fernando Lopez updated HELP-9252:
---------------------------------
Status: Answered (was: In Progress)
> [fiware-stackoverflow] FiWare WP-OAuth user authentication PHP CURL
> -------------------------------------------------------------------
>
> Key: HELP-9252
> URL: https://jira.fiware.org/browse/HELP-9252
> Project: Help-Desk
> Issue Type: Monitor
> Components: FIWARE-TECH-HELP
> Reporter: Backlog Manager
> Assignee: Alvaro Alonso
> Labels: curl, fiware, php
>
> Created question in FIWARE Q/A platform on 09-06-2015 at 21:06
> {color: red}Please, ANSWER this question AT{color} https://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);
--
This message was sent by Atlassian JIRA
(v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy