You are here

function oauth2_server_revoke_page in OAuth2 Server 7

Page callback: revoke a token.

1 string reference to 'oauth2_server_revoke_page'
oauth2_server_menu in ./oauth2_server.module
Implements hook_menu().

File

./oauth2_server.pages.inc, line 167
Page callbacks for the OAuth2 Server module.

Code

function oauth2_server_revoke_page() {
  $request = OAuth2\Request::createFromGlobals();
  $server = oauth2_server_from_request($request);
  $response = new OAuth2\Response();
  if (!method_exists($server, 'handleRevokeRequest')) {
    watchdog('oauth2_server', 'Version >= 1.8.0 of the oauth2-server-php library is required for revoke requests', array(), WATCHDOG_ERROR);
    $response
      ->setStatusCode(500);
  }
  else {
    $server
      ->handleRevokeRequest($request, $response);
  }
  return oauth2_server_send_response($response);
}