为什么在尝试使用 Evernote 进行身份验证时会收到 KeyError? [英] Why am I getting a KeyError when attempting to authenticate with Evernote?

查看:81
本文介绍了为什么在尝试使用 Evernote 进行身份验证时会收到 KeyError?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 oauth 身份验证过程中尝试调用 Evernote Python SDK 的 get_access_token 时收到以下错误消息.

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')

请注意,根据此处的讨论,我将 token_secret 参数保留为空白字符串:

Note that I'm leaving the token_secret argument as a blank string based on the discussion here:

https://discussion.evernote.com/主题/18710-access-token-secret-returning-blank/

感谢您提供有关成功的 Evernote oauth 集成的任何建议或代码示例.

Thanks for any advice or code samples of successful Evernote oauth integration.

推荐答案

Evernote SDK 有基于 Django 和基于 Pyramid 的服务器示例来执行 OAuth 身份验证:https://github.com/evernote/evernote-sdk-python/tree/master/sample/django/oauth

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 程序在 https://dev.evernote.com/doc/中有描述文章/authentication.php 并且您可以使用任何 OAuth 1.0 Python 库来实现服务器(大多数 OAuth 库都有可重用的示例代码;除了提供您的 api 密钥和secret 是 Evernote OAuth 服务器 URL:https://sandbox.evernote.com/oauth 用于沙箱,和 `` .要启动 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.

这篇关于为什么在尝试使用 Evernote 进行身份验证时会收到 KeyError?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆