Package restkit :: Module oauth2 :: Class Token
[hide private]

Class Token

source code

object --+
         |
        Token

An OAuth credential used to request authorization or a protected resource.

Tokens in OAuth comprise a *key* and a *secret*. The key is included in requests to identify the token being used, but the secret is used only in the signature, to prove that the requester is who the server gave the token to.

When first negotiating the authorization, the consumer asks for a *request token* that the live user authorizes with the service provider. The consumer then exchanges the request token for an *access token* that can be used to access protected resources.

Instance Methods [hide private]
 
__init__(self, key, secret)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
set_callback(self, callback) source code
 
set_verifier(self, verifier=None) source code
 
get_callback_url(self) source code
 
to_string(self)
Returns this token as a plain string, suitable for storage.
source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
 
from_string(s)
Deserializes a token from a string like one returned by `to_string()`.
source code
Class Variables [hide private]
  key = None
hash(x)
  secret = None
hash(x)
  callback = None
hash(x)
  callback_confirmed = None
hash(x)
  verifier = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, key, secret)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

to_string(self)

source code 

Returns this token as a plain string, suitable for storage.

The resulting string includes the token's secret, so you should never send or store this string where a third party can read it.

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)