Module bluevia :: Class BlueViaOauth
[hide private]
[frames] | no frames]

Class BlueViaOauth

source code

BlueVia --+
          |
         BlueViaOauth
Known Subclasses:

This class provides the methods for the oAuth Dance. It supports Out Of Band authorization as defined in oAuth 1.0a

Instance Methods [hide private]
 
__init__(self, consumer_key, consumer_secret, realm='BlueVia')
Initialize the BlueViaOauth object
source code
 
fetch_request_token(self, callback='oob')
First call of the oAuth Dance.
source code
 
fetch_access_token(self, verifier)
The final step of the oAuth Dance.
source code
 
saveAccessToken(self, path)
Save the Access Token.
source code
 
getConsumer(self)
Retrieve the Consumer Credentials
source code
 
getAccessToken(self)
Retrieve the Access Token
source code

Inherited from BlueVia: hasCredentials, loadAccessToken, setAccessToken, setConsumer, setDebug

Inherited from BlueVia (private): _debug, _signAndSend

Class Variables [hide private]

Inherited from BlueVia: access_token, consumer, debugFlag, environment, http, realm, version

Method Details [hide private]

__init__(self, consumer_key, consumer_secret, realm='BlueVia')
(Constructor)

source code 

Initialize the BlueViaOauth object

Parameters:
  • consumer_key - (string): Key of the Consumer Credentials
  • consumer_secret - (string): Secret of the Consumer Credentials
  • realm - (string): Realm string. Default: "BlueVia"

fetch_request_token(self, callback='oob')

source code 

First call of the oAuth Dance. Provide the Consumer Credential and request the Request Token

Parameters:
  • callback - (string): The callback URL or "oob". Default: "oob"
Returns:
(tuple): (HTTP status, authorization URL). HTTP status == "200" for success

fetch_access_token(self, verifier)

source code 

The final step of the oAuth Dance. Exchange the Request Token with the Access Token

Parameters:
  • verifier - (string): The oAuth verifier of the successful user authorization
Returns:
(string): HTTP status == "200" for success

saveAccessToken(self, path)

source code 

Save the Access Token.

Note: Unencrypted storage. Use only during development

Parameters:
  • path - (string): Path to file on disk (pickle file)