You are here

public function OAuthServer::fetch_access_token in OAuth 1.0 6

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthServer::fetch_access_token()
  2. 7.3 lib/OAuth.php \OAuthServer::fetch_access_token()

process an access_token request returns the access token on success

File

./OAuth.php, line 491

Class

OAuthServer

Code

public function fetch_access_token(&$request) {

  /*{{{*/
  $this
    ->get_version($request);
  $consumer = $this
    ->get_consumer($request);

  // requires authorized request token
  $token = $this
    ->get_token($request, $consumer, "request");
  $this
    ->check_signature($request, $consumer, $token);
  $new_token = $this->data_store
    ->new_access_token($token, $consumer, $uid);
  return $new_token;
}