I've installed WP OAuth Server to make an SSO thing with my Wordpress, but I can't get it to work proper.
I followed this example on how to set up Single Sign On. I'm stuck at Step 3.
I get this error:

object(stdClass)#1 (2) { ["error"]=> string(15) "invalid_request" ["error_description"]=> string(47) "The grant type was not specified in the request" } 

And here's the example code from step 3.

$curl_post_date = array(
'grant_type' => 'authorization_code',
'code' => $_GET['code'],
'redirect_uri' => '{http://example.net}'
$service_url = 'example.com/oauth/token';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_USERPWD, "MY CLIENT ID:SECRET KEY"); //Your credentials goes here
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // If the url has https and you don't want to verify source certificate

$curl_response = curl_exec($curl);
$response = json_decode($curl_response);


Step 3 should output somthing like this:


How do I get step 3 to work as it should?

  • plugins are off-topic. you should ask the authors. – Mark Kaplun Sep 4 '15 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.