Javascript 如何使用OAuth.io通过Evernote开发者帐户进行身份验证
我有一项任务要创建SPA,该SPA将使用Evernote帐户数据。对于身份验证,我想使用Oauth.io服务。 Oauth.io站点上的“Try auth”按钮工作正常。我看到弹出窗口提示登录 在我的应用程序html中,我有一个简单的按钮:Javascript 如何使用OAuth.io通过Evernote开发者帐户进行身份验证,javascript,html,evernote,Javascript,Html,Evernote,我有一项任务要创建SPA,该SPA将使用Evernote帐户数据。对于身份验证,我想使用Oauth.io服务。 Oauth.io站点上的“Try auth”按钮工作正常。我看到弹出窗口提示登录 在我的应用程序html中,我有一个简单的按钮: <button id="login-evernote-btn" type="button" class="bx-button bx-button-accept" onclick="app.loginWithEvernote();"><i c
<button id="login-evernote-btn" type="button" class="bx-button bx-button-accept" onclick="app.loginWithEvernote();"><i class="fa fa-sign-in"></i> Evernote Login</button>
但点击我的按钮后,我看到飞溅窗口在第二秒内关闭。我无法输入我的凭据
我做错了哪一步
成功验证后,我想使用Evernote API列出所有注释。您需要记录错误,以查看弹出窗口的问题所在。可能是域白名单或使用“evernote”提供程序而不是“evernote\u sandbox” 根据github,您可以通过这种方式使用您的令牌
Application.prototype.loginWithEvernote = function() {
OAuth.popup('evernote').done(function(evernote) {
var client = new Evernote.Client({token: evernote.oauth_token});
var noteStore = client.getNoteStore();
notebooks = noteStore.listNotebooks(function(err, notebooks) {
// run this code
});
}).fail(function(e) {
console.error(e)
});
};
Application.prototype.loginWithEvernote = function() {
OAuth.popup('evernote').done(function(evernote) {
var client = new Evernote.Client({token: evernote.oauth_token});
var noteStore = client.getNoteStore();
notebooks = noteStore.listNotebooks(function(err, notebooks) {
// run this code
});
}).fail(function(e) {
console.error(e)
});
};