Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
HD-Chapter:Security
-
HD-Enabler:KeyRock
Description
Created question in FIWARE Q/A platform on 09-06-2015 at 21:06
Please, ANSWER this question AT 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":
}
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
Field | Original Value | New Value |
---|---|---|
Component/s | FIWARE-TECH-HELP [ 10278 ] |
Assignee | Alvaro Alonso [ aalonsog ] |
HD-Enabler | KeyRock [ 10889 ] | |
Description |
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); |
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); |
HD-Chapter | Security [ 10841 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Answered [ 10104 ] |
Resolution | Done [ 10000 ] | |
Status | Answered [ 10104 ] | Closed [ 6 ] |
Fix Version/s | 2021 [ 12600 ] |
Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
---|---|---|---|---|---|---|---|---|---|
|
2h 58m | 1 | Fernando Lopez | 26/May/17 9:02 PM | |||||
|
1s | 1 | Fernando Lopez | 26/May/17 9:02 PM | |||||
|
1s | 1 | Fernando Lopez | 26/May/17 9:03 PM |
2017-05-26 18:05|CREATED monitor | # answers= 1, accepted answer= False