多个Facebook账户捆绑到一个应用程序 [英] Multiple Facebook accounts tied into one app

查看:167
本文介绍了多个Facebook账户捆绑到一个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出有多个Facebook账号绑成我的应用程序。因此,当不同的用户登录,他们可以访问其个人Facebook账户。

我想有我的应用程序有它自己的登录。他们中的用户登录后有他们的Facebook帐户的选项。但是,由于有多个用户,我需要弄清楚如何将多个Facebook账户相关联。

下面是我走到这一步:搜索


  1. Facebook的对话框验证,因为SSO使用Facebook应用程序,因此只允许一个fbook帐户一次。

  2. 服务器端身份验证,因为我想访问令牌体面长(60天)持续,而无需重新登录到Facebook上,当他们使用我的应用程序的每个用户。

下面是我挂断:结果


  1. 如何重新申请令牌一旦用户登录到我的应用程序(已关联的Facebook帐户之后)。这是正确的方法是什么?任何人都可以重新申请一个令牌提供的教程或code?

     私人facebook MFB;
    mFb.setAccessToken(TOKEN);


  2. 任何人都可以提供code如何设置服务器端身份验证



解决方案

有关的新的Facebook SDK 3.0b中为Android(http://developers.facebook.com/android),我们包含了一个叫做SwitchUserSample这可能是新样本一个很好的起点为您服务。

在撰写的时间(因为SDK仍处于测试阶段,在'preVIEW'分支),你可以在的https://github.com/facebook/facebook-android-sdk/tree/$p$pview/samples/SwitchUserSample - 当然样品(含工程文件)也是在SDK本身

I'm trying to figure out to have multiple facebook accounts tied into my app. So that when different users login, they can access their individual facebook accounts.

I would like to have my app have it's own login. After a user logs in they have the option to connect their facebook account. But because there are multiple users I need to figure out how to associate multiple facebook accounts.

Here's what I got so far:

  1. Facebook Dialog Auth because SSO uses the Facebook App, thus only allowing one fbook account at a time.
  2. Server Side Auth because I would like the access tokens to last decently long (60 days) without each user having to relog into facebook when they use my app.

Here are my hangups:

  1. How do I reapply a token once the user has logged into my app (after already associating their facebook account). Is this the correct method? Can anyone provide a tutorial or code for reapplying a token?

    private Facebook mFb;
    mFb.setAccessToken(TOKEN);
    

  2. Can anyone provide code on how to setup Server Side Auth?

解决方案

For the new Facebook SDK 3.0b for Android (http://developers.facebook.com/android), we include a new sample called SwitchUserSample which might be a good starting point for you.

As at the time of writing (since the SDK is still in beta and on the 'preview' branch), you can find the sample's code in GitHub at https://github.com/facebook/facebook-android-sdk/tree/preview/samples/SwitchUserSample - and of course the sample (with project files) is also in the SDK itself.

这篇关于多个Facebook账户捆绑到一个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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