Why am I getting a KeyError when attempting to authenticate with Evernote?

旧巷老猫 提交于 2019-12-11 16:56:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!