且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Facebook的身份验证为一个Android应用程序

更新时间:2023-12-06 16:10:16

 这意味着,如果用户已经通过他的设备连接到Facebook,我承认,在我的应用程序中使用它 - 不要求用户提供一个新的登录。

是有可能。这被称为单点登录在Facebook中,默认情况下单点登录是的启用。你必须做一个和唯一的事情是,你需要生成散列密钥和注册与Facebook中创建的应用程序。

此外,也可以通过如下传递一个额外的参数来禁用单单开:

  authenticatedFacebook.authorize(上下文的权限,-1,新LoginListener());

-1 - 指禁用SSO

单点登录的 Facebook的文档 ..

I am working on an application where I need to integrate the social functionality of Facebook.

What I want is to know if the user is already connected to Facebook through a Facebook application or some other application that uses Facebook, and use this authentication. That means that if the user is already connect to Facebook through his device I recognize that and use it in my application - not ask the user for a new login.

Is it possible?

I found a lot stuff in the web, but nothing is related to that. I already downloaded the facebook SDK and added it to my project. I saw that there is a method (facebook.getAccessToken()) to get the access token, but I think I can use it only if the user do his first login in my application.

Any help would be great. Thanks.

That means that if the user is already connect to Facebook through his device I recognize that and use it in my application - not ask the user for a new login. 

Yes it is possible..This is called as Single-Sign-On in facebook , by default Single-Sign-On is enabled. One and only thing you have to do is that you need to generate Hash Key and Register with your Application created in Facebook.

Also it is possible to disable Single-Single-On by passing an extra parameter as below :

authenticatedFacebook.authorize(context PERMISSIONS,-1,new LoginListener());

-1 - refers disabling SSO

Single-Sign-On is clearly explained in Facebook Documentation..