You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to revoke a token in php using this lib but I keep getting a false after calling handleRevokeRequest I'm struggling to find working example on the web
public function revokeToken($token, $sendError = true, $method = null)
{
require_once dirname(__FILE__) . '/vendor/autoload.php';
require_once dirname(__FILE__) . '/OAuthStorage.class.php';
OAuth2\Autoloader::register();
$storage = new OAuth2\Storage\OvidentiaOAuthStorage();
$server = new OAuth2\Server($storage);
// Add the 'Authorization Code' grant type (this is where the oauth magic happens)
$server->addGrantType(new OAuth2\GrantType\AuthorizationCode($storage));
if ($method == null) {
$method = $_SERVER['REQUEST_METHOD'];
}
$request = new OAuth2\Request(array(), array('token' => $token), array(), array(), array(), array('REQUEST_METHOD' => $method));
if (!$server->handleRevokeRequest($request)) {
if ($sendError === true) {
$server->getResponse()->send();
die;
} else {
$this->errorMessages = array();
$error = $server->getResponse()->getParameters();
if (isset($error['error_description'])) {
var_dump($error['error_description']);
$this->errorMessages[] = $error['error_description'];
}
return false;
}
} else {
var_dump("else");
}
return true;
}
The text was updated successfully, but these errors were encountered:
I'm trying to revoke a token in php using this lib but I keep getting a false after calling handleRevokeRequest I'm struggling to find working example on the web
The text was updated successfully, but these errors were encountered: