You are here

function DrupalOAuthDataStore::new_request_token in OAuth 1.0 7.4

Same name and namespace in other branches
  1. 6.3 includes/DrupalOAuthDataStore.inc \DrupalOAuthDataStore::new_request_token()
  2. 6 oauth.module \DrupalOAuthDataStore::new_request_token()
  3. 7.3 includes/DrupalOAuthDataStore.inc \DrupalOAuthDataStore::new_request_token()

Generate a new request token.

Parameters

OAuthConsumer $consumer: The consumer to generate a token for.

Return value

DrupalOAuthToken The request token

Overrides OAuthDataStore::new_request_token

File

includes/DrupalOAuthDataStore.inc, line 106

Class

DrupalOAuthDataStore
Database abstraction class

Code

function new_request_token($consumer, $callback = NULL) {
  $token = new DrupalOAuthToken(user_password(32), user_password(32), $consumer, array(
    'type' => OAUTH_COMMON_TOKEN_TYPE_REQUEST,
    'uid' => 0,
    'expires' => REQUEST_TIME + variable_get('oauth_common_request_token_lifetime', 7200),
  ));
  $token
    ->write();
  return $token;
}