Hi, i followed this tutorial from http://bshaffer.github.io/oauth2-server-php-docs/cookbook/ and everything okey. but, yesterday, i'm got error " 'error' => string 'invalid_grant'
'error_description' => string 'Authorization code doesn't exist or is invalid for the client' ".
Below my code :
server.php
<?php
require_once ('include/OAuth2/Autoloader.php');
OAuth2\Autoloader::register();
Hi, i followed this tutorial from http://bshaffer.github.io/oauth2-server-php-docs/cookbook/ and everything okey. but, yesterday, i'm got error " 'error' => string 'invalid_grant' 'error_description' => string 'Authorization code doesn't exist or is invalid for the client' ".
Below my code : server.php <?php require_once ('include/OAuth2/Autoloader.php'); OAuth2\Autoloader::register();
ini_set('display_errors',1); error_reporting(E_ALL);
$dsn = 'mysql:dbname=mlvm2;host=localhost'; $user = 'root'; $pass = 'mleisure';
$storage = new OAuth2\Storage\Pdo(array('dsn' => $dsn, 'username' => $user, 'password' => $pass)); $server = new OAuth2\Server($storage,array('always_issue_new_refresh_token' => true));
$request = OAuth2\Request::createFromGlobals(); $server->handleTokenRequest($request); $response = new OAuth2\Response();
$server->addGrantType(new OAuth2\GrantType\ClientCredentials($storage)); $server->addGrantType(new OAuth2\GrantType\AuthorizationCode($storage)); ?>
authorize.php <?php require_once DIR.'/server.php';
?>
token.php <?php $curl_post_data = array( 'grant_type' => $_GET['grant_type'], 'code' => $_GET['code'], 'redirect_uri' => 'http://localhost/web/', );
?>
what can i do for resolved this error.