在 Facebook 和 Facebook 上共享您的应用程序中的项目Twitter - 存储凭证

发布于 2024-11-09 22:43:37 字数 485 浏览 4 评论 0原文

如果您有一个 Web 应用程序,允许用户选择在 Facebook 和 Twitter 上分享他们的活动,我想知道将社交身份验证构建到您的应用程序中的正确方法是什么(以及与 Facebook 和 Twitter 政策一致的内容) )这样您就可以发推文并在墙上发帖。

您是否将用户的用户名和密码存储在数据库中?
然后使用这些凭据调用社交 API。据我目前所知,这两个 API 都可以让您执行 OAuth 重定向操作。他们是一种无需对话交互即可做到这一点的方法吗,因为您现在已经存储了用户名和密码。

不确定这是否是一个问题,但是对于那些想要在 Facebook 和 Twitter 上共享的用户,您是否必须在下一次握手后立即进行两次 OAuth 握手。
每次用户分享内容时您都必须这样做吗?

我刚刚启动了 TweetDeck,不需要通过与 Twitter 进行某些交流来重定向。使困惑。

对于基于网络的应用程序,只需要一些关于“大多数人如何做”的帮助和指导。 提示和重定向越少越好。

If you have a web application that will allow the users to opt-in to sharing their activity on Facebook and Twitter I'm wondering what is the right way to architect that social authentication into your application (and what is inline with Facebook and Twitter policies) so that you can tweet and post on your wall.

Do you store the users username and password in your database?
And then call the social APIs with these credentials. From what I have learned so far both these APIs make you do an OAuth redirect thing. Is their a way to do that without the dialog interaction since you now have stored the username and password anyways.

Not sure if this is an issue, but do you have to do two OAuth handshakes one right after the next to post to Facebook and then Twitter for those users that want to share on both.
And would you have to do this each and every time the user shares something?

I just launched TweetDeck and I wasn't required to get redirected through some exchange with Twitter. Confused.

Just need some help and guidance with "how most people do it" for web-based applications.
The less prompting and less redirects the better.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千寻… 2024-11-16 22:43:37

我不认为存储用户名和密码是一个好方法,因为我认为大多数用户会反对您将用户名和密码保存在文件中。我没有在 Twitter 上做过任何工作,但在 Facebook 上你需要创建一个 App,然后要求用户授予你的应用权限。这些权限要求用户登录 Facebook 才能工作,除非您请求 Offline_access 权限。根据我的经验,您请求的权限越少,愿意授予您这些权限的用户就越多。我的方法是始终请求让应用程序运行所需的最低权限。授予您的应用程序权限后,您每次想要与用户的 Facebook 帐户交互时都需要获取 OAuth 令牌。 (据我所知,这些令牌的有效期约为 60 分钟)存储这些令牌不会有任何帮助,因为它们会过期。希望这能为您指明正确的方向。

I don't think storing the username and password would be a good way to go since I think most users would object to you keeping thiere usernames and passwords on file. I have not done any work with Twitter, but on Facebook you need to create an App and then ask the user to grant your app rights. These rights require the user to be loged in to Facebook in order to work, unless you request the offline_access permmission. From my experience, the fewer permmissions you request, the more users will be willing to grant you these permmissions. My approach is to always request the minimal permmissions I need to get the App to work. After granting your App permmissions, you need to get an OAuth token each time you want to interact with the user's Facebook account. (These tokens are good for about 60 minutes, as far as I remember) Storing these tokens will not help, since they expire. Hope this points you in the right direction.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文