Skip to content

Instantly share code, notes, and snippets.

@DevJohnC
Created August 3, 2012 21:00
Show Gist options
  • Select an option

  • Save DevJohnC/3251469 to your computer and use it in GitHub Desktop.

Select an option

Save DevJohnC/3251469 to your computer and use it in GitHub Desktop.
python oauth request
url = "etrade request credentials url"
consumer = oauth.Consumer(key="your consumer key", secret="your secret")
params = {
'oauth_nonce': oauth.generate_nonce(),
'oauth_timestamp': int(time.time()),
'oauth_callback': 'oob',
'oauth_consumer_key': consumer.key
}
req = oauth.Request(method="POST", url=url, parameters=params)
signature_method = oauth.SignatureMethod_HMAC_SHA1()
req.sign_request(signature_method, consumer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment