You are here

class OAuthToken in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthToken
  2. 6 OAuth.php \OAuthToken

Hierarchy

Expanded class hierarchy of OAuthToken

File

lib/OAuth.php, line 37
OAuth 1.0 server and client library.

View source
class OAuthToken {

  // access tokens and request tokens
  public $key;
  public $secret;

  /**
   * key = the token
   * secret = the token secret
   */
  function __construct($key, $secret) {
    $this->key = $key;
    $this->secret = $secret;
  }

  /**
   * generates the basic string serialization of a token that a server
   * would respond to request_token and access_token calls with
   */
  function to_string() {
    return "oauth_token=" . OAuthUtil::urlencode_rfc3986($this->key) . "&oauth_token_secret=" . OAuthUtil::urlencode_rfc3986($this->secret) . "&oauth_callback_confirmed=true";
  }
  function __toString() {
    return $this
      ->to_string();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OAuthToken::$key public property
OAuthToken::$secret public property
OAuthToken::to_string function generates the basic string serialization of a token that a server would respond to request_token and access_token calls with
OAuthToken::__construct function key = the token secret = the token secret 1
OAuthToken::__toString function