如何处理与OAuth的多个帐户? [英] How to process multiple accounts with OAuth?

查看:134
本文介绍了如何处理与OAuth的多个帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,通过存储用户名和密码的数组职位,以多个Twitter帐号。近日,微博更新了自己的API,所以我必须使用OAuth而不是存储凭据进行身份验证。我怎么会使得在一个单一的过程?

I have an application that posts to multiple Twitter accounts by storing an array of usernames and passwords. Recently, Twitter updated their API so I have to authenticate using OAuth instead of storing credentials. How would I make the user authenticate for multiple Twitter accounts during a single process?

例如对于多个Twitter帐号的用户进行身份验证,我有一个提交按钮一个文本框。当用户点击提交按钮,我想文本框的值张贴到用户1,用户2和用户3的Twitter帐户。这意味着他们将不得不在同一时间同时登录3个帐户为这个单一的点击工作的权利? ?这怎么可能。

For example, I have a textbox with a submit button. When the user clicks on the submit button, I want the textbox value to post to user1, user2, and user3's Twitter account. This means they would have to be simultaneously logged into 3 accounts at the same time for this single click to work right? How is this possible?

PS - 我对于Facebook这样做太是相同的API / OAuth的概念,这就是为什么我与Facebook API标记一样好

PS -- I am doing this for Facebook too and is the same API / OAuth concept, which is why I tagged it with Facebook API as well.

推荐答案

用户不必同时登录3个帐户;但他确实有您的应用程序使用三次不同的帐户授权。

The user doesn't have to be simultaneously logged into 3 accounts; but he does have to authorize your app thrice using different accounts.

请参阅的 Twitter的OAuth的常见问题解答 - 访问令牌不会过期。一旦用户授权您的应用程序,你存储在数据库中的访问令牌。然后你只需重复这个过程一遍,并存储下一个访问令牌。

See Twitter's OAuth FAQ - The access token does not expire. Once the user authorizes your app, you store the access token in your database. Then you just repeat the process all over again and store the next access token.

与Facebook,令牌是短暂的,但你可以为的扩展权限offline_access。这将让你实现大致同样的事情叽叽喳喳。

With Facebook, the tokens are short-lived, but you can request for the extended permission "offline_access". That would allow you to roughly achieve the same thing as twitter.

这篇关于如何处理与OAuth的多个帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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