我如何保存LinkedIn API的accessToken所以我不必重新输入凭据,我每次使用LinkedIn的API的时间? [英] How do I store the LinkedIn API AccessToken so I don't have to re-enter credentials every time I use the LinkedIn API?

查看:247
本文介绍了我如何保存LinkedIn API的accessToken所以我不必重新输入凭据,我每次使用LinkedIn的API的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的 LinkedIn 的应用矿山信息。
只发现了一个code样品迄今OAuth的。我无法理解的OAuth的工作流程,例如:

I am writing an app to mine information from LinkedIn. I've only found one code sample thus far on oAuth. I'm having trouble understanding the workflow of oAuth, for example:


  1. 为例询问的用户名/密码组合登录到LinkedIn,并返回一个道理,但对我来说,我会一直使用相同的LinkedIn帐户。

  1. The Example asks for the Username/Password combination to log into LinkedIn and return a token, but in my case, I will always use the same LinkedIn Account.

由于我总是会使用相同的用户访问LinkedIn的API,是有办法做到这一点,所以我不必重新输入所有的访问请求的用户名和密码? Facebook的API允许我设置令牌不会过期,从而使我保存这个令牌作为一个属性我的应用程序中)。

Since I'm always going to be using the same user to access the LinkedIn API, is there a way to do it so I don't have to re-enter the user name and password for every access request? The facebook API allows me to set the Token to not expire, thereby allowing me to save this token as an Attribute inside my application).

的理念是:


  1. 获取令牌一定LinkedIn帐户

  2. 在我的应用程序很难$ C $音像店吧,因为这是我将使用检索LinkedIn信息的唯一帐户。

  3. 使用此令牌进行API调用,每次我需要它

  4. 解析JSON / XML文件

我怎么做这在C#?

推荐答案

您首先需要决定会员的令牌,以及相应的OAuth令牌 - 你可以做到这一点作为一个一次性和LinkedIn有一定的有关授权(链接到工具来验证一起,并且你可以用它来simplyify事项库)相当不错的文档

You first need to determine the member token, and the corresponding OAuth token -- you could do this as a one off, and LinkedIn have some quite good documentation about authorizing (along with links to tools to verify, and to libraries that you can use to simplyify matters)

一旦你拥有了这些,它只是将它们存储安全的地方的情况下 - 有一个在的 LinkedIn的API使用条款允许存储:

Once you have those, it's just a case of storing them "somewhere safe" - there is even a clause in the LinkedIn APIs Terms of Use that permits storage:

您可以存储会员令牌和OAuth令牌,直到较早的:

You may store the Member Token and the OAuth Token until the earlier of:


      
  • 您停任使用API​​;

  •   
  • 的LinkedIn用户卸载应用程序或指导您删除用户的信息;或者,

  •   
  • 我们终止你对他们的使用了违反这些条款。

  •   

这篇关于我如何保存LinkedIn API的accessToken所以我不必重新输入凭据,我每次使用LinkedIn的API的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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