检索身份验证令牌的Facebook账户通过在Android的客户经理在手机配置 [英] Retrieving auth token for facebook account configured in mobile via account manager in android

查看:327
本文介绍了检索身份验证令牌的Facebook账户通过在Android的客户经理在手机配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得身份验证令牌,使用通过客户经理在设备配置在Android中一个Facebook帐户

I am trying to get Auth token for a facebook account configured in device via account manager in android using

accountManager.getAuthToken(account,"user_activities",null,Hellol10n.this, new   GetAuthTokenCallback(), null);// account is of type "com.facebook.auth.login"

但我不得到任何结果。回调不获取所有调用。

But i dont get any result. The callback is not getting invoked at all.

实是否获得支持的身份验证令牌的这种方式。 Facebook的确实使用的oauth2。所以,看看

Does facebook support this way of getting auth token. Facebook do use oauth2. So have a look at

本课演示连接至支持的OAuth2一个谷歌服务器。虽然谷歌服务作为一个例子,演示的技术将工作能正确支持的OAuth2协议的服务。

This lesson demonstrates connecting to a Google server that supports OAuth2. Although Google services are used as an example, the techniques demonstrated will work on any service that correctly supports the OAuth2 protocol."

http://developer.android.com/training/id-auth/ authenticate.html

另外,我想这becoz我不希望用户在他的装置,使用户体验简单的已经配置凭据的帐户类型。

Also, i am trying this becoz i dont want the user to type in the credentials for an account he has already configured in the device to make the user experience simple.

更新:

还有客户经理类型的FB账号com.sec.android.app.snsaccountfacebook.account_type,即使没有安装Facebook应用程序。它是不可能得到这个account.What的权威性在客户经理的帐户类型com.sec.android.app.snsaccountfacebook.account_type和com.facebook.auth.login

Also account manager has a fb account of type "com.sec.android.app.snsaccountfacebook.account_type" even if the facebook app is not installed. Is it not possible to get the auth of this account.What is the difference between the account types "com.sec.android.app.snsaccountfacebook.account_type" and "com.facebook.auth.login" in account manager

推荐答案

我会建议使用的Facebook SDK为Android 来代替。如果用户在Facebook应用程序,则只需SSO切换到应用程序的认证和授权,而且也没有必要重新输入用户名/密码。如果用户没有在Facebook的应用程序,那么accountManager.getAuthToken机制将不会反正由于Android不会有帐户信息工作。

I would recommend using the Facebook SDK for Android instead. If the user has the Facebook app, then SSO simply switches to the app for authentication and authorization, and there's no need to reenter the username/password. If the user does not have the Facebook app, then the accountManager.getAuthToken mechanism wouldn't work anyways since Android wouldn't have the account info.

这篇关于检索身份验证令牌的Facebook账户通过在Android的客户经理在手机配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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