I'm trying to authenticate using OAuth in OpenX (site does not render well in chrome. Use iexplore or safari.)
This is my piece of code
# Login
$url = "https://sso.openx.com/api/index/token";
$post = http_build_query( array( 'Access Token URL' => 'https://sso.openx.com/api/index/token',
'Authorize URL' => 'https://sso.openx.com/login/login',
'callbackUrl' => 'oob',
'Consumer Key' => $key,
'Consumer Secret' => $secret,
'OAuth Realm' => $realm,
'Request Token URL' => 'https://sso.openx.com/api/index/initiate',
'Signature Method' => 'HMAC-SHA1 ',
'Version' => '1.0a ') );
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($resource, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$json_response = curl_exec($curl);
var_dump($json_response);
curl_close($curl);
$authObj = json_decode($json_response);
And, according to the linked documentation, I should be expecting an oauth_token and oauth_verifier:
1.Set the callbackUrl to oob (out-of-band), which tells the OAuth server that you are not redirecting a user. The OAuth Server returns the request token.
but instead I'm getting:
HTTP/1.1 400 Bad Request - Invalid Request: Missing parameters
Am I doing something obviously wrong here that I am missing? Am I misunderstanding something in the linked documentation?
Any sort of help is welcome, either aimed at the problem itself or to the way it's been presented; answers, hints, ideas, corrections, etc.
Thank you.