问题
I am receiving the following error message when attempting to call the Evernote Python SDK's get_access_token
in the oauth authentication process.
KeyError: 'oauth_token'
My code looks like this.
auth_token = client.get_access_token('gjones.166A170DC72.687474703A2F2F6C6XXXX16C686F7374.0DAED5A65D9EDE49231B754CEE6BXXXD','','BXXXE3B3CDA07E91D800FD2679DCXXX8')
Note that I'm leaving the token_secret argument as a blank string based on the discussion here:
https://discussion.evernote.com/topic/18710-access-token-secret-returning-blank/
Thanks for any advice or code samples of successful Evernote oauth integration.
回答1:
Evernote SDK has both Django- and Pyramid-based server examples that perform OAuth authentication: https://github.com/evernote/evernote-sdk-python/tree/master/sample/django/oauth
OAuth procedure is described in https://dev.evernote.com/doc/articles/authentication.php and you can use any OAuth 1.0 Python library to implement the server (most OAuth libraries have a reusable example code; the only thing you will likely need to change there, apart from providing your api key and secret, is Evernote OAuth server URL: https://sandbox.evernote.com/oauth
for sandbox, and `` . To initiate the OAuth sequence, you need to pass both consumer key and consumer secret.
来源:https://stackoverflow.com/questions/53304196/why-am-i-getting-a-keyerror-when-attempting-to-authenticate-with-evernote