【问题标题】:Authentication on Evernote using C#使用 C# 在 Evernote 上进行身份验证
【发布时间】:2017-05-11 10:27:19
【问题描述】:

我在尝试使用 Evernote API 密钥在 Evernote 上进行身份验证时遇到问题。我在做

ENSession.SetSharedSessionConsumerKey("my key", "my secret");

if (ENSession.SharedSession.IsAuthenticated == false)
{
    ENSession.SharedSession.AuthenticateToEvernote();
}

ENSession.SetSharedSessionConsumerKey("my key","my secret"); 工作正常。我的意思是它没有返回值,所以我无法真正检查。但是当我尝试进行身份验证时,使用ENSession.SharedSession.AuthenticateToEvernote(); ENSession.SharedSession.IsAuthenticated 仍然是错误的。我读到here 这个方法会打开一个 Webbrowser (?) 窗口并要求进行身份验证。然而什么也没发生。因此,我假设此方法需要系统首选的 Web 浏览器,但似乎又没有。

我正在使用 Visual Studio Community 2015,并且我已经通过 NuGet 安装了 Evernote SDK。

有什么问题?是方法坏了,还是我的VS配置错了(我还没弄乱VS配置)

【问题讨论】:

    标签: c# visual-studio evernote


    【解决方案1】:

    我发现了我的错误:搜索 Evernote API 的源代码,我发现了这个:

    ///**
        //*  Set up the session object with an app consumer key and secret. This is the standard setup
        //*  method. App keys are available from dev.evernote.com. You must call this method BEFORE the
        //*  sharedSession is accessed.
        //*
        //*   key    Consumer key for your app
        //*   secret Consumer secret for yor app
        //*   host   (optional) If you're using a non-production host, like the developer sandbox, specify it here.
        //*/
        public static void SetSharedSessionConsumerKey(string sessionConsumerKey, string sessionConsumerSecret, string sessionHost = null)
    

    所以我刚刚打电话给SetSharedSessionConsumerKey("key", "secret", "sandbox.evernote.com");,一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多