简体   繁体   English

用于服务器端身份验证的Android Facebook SSO

[英]Android Facebook SSO for server side authentication

I am using FB SSO for an Android App and I would like to use the Facebook ID to authenticate my users when they upload data to my server. 我正在使用FB SSO作为Android应用程序,我想使用Facebook ID在我的用户上传数据到我的服务器时对其进行身份验证。 I imagine I should send the OAuth token when making the call to the server. 我想我应该在调用服务器时发送OAuth令牌。 Any examples out there that could help me get started? 有什么例子可以帮助我开始吗?

Thanks for any pointers. 谢谢你的任何指示。

I have faced the same problem a while ago. 我前一段时间遇到过同样的问题。 In the end, I did it using the following way: 最后,我使用以下方式完成:

I get the token via Facebook Android SDK and pass it to my server with the users email address and facebook id. 我通过Facebook Android SDK获取令牌,并将其传递给我的服务器,其中包含用户的电子邮件地址和Facebook ID。 Server tries to get users email address using the token. 服务器尝试使用令牌获取用户电子邮件地址。 If the email addresses match, the user has authenticated. 如果电子邮件地址匹配,则用户已经过身份验证。

Can you please clarify further, you want to authenticate user on your server via Facebook ID? 您能否进一步澄清一下,您想通过Facebook ID在服务器上验证用户身份吗? The access token received via SSO will allow you to call graph apis, FQL query etc. which may require special permissions depending upon what you want to do. 通过SSO接收的访问令牌将允许您调用图形api,FQL查询等,这可能需要特殊权限,具体取决于您要执行的操作。

More on Android SDK: https://developers.facebook.com/docs/guides/mobile/#android 有关Android SDK的更多信息: https//developers.facebook.com/docs/guides/mobile/#android

More on Permissiosn: https://developers.facebook.com/docs/reference/api/permissions/ 有关Permissiosn的更多信息: https//developers.facebook.com/docs/reference/api/permissions/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM