How can I authenticate to my applications webservice after using Facebook SSO on Android?

前端 未结 2 669
甜味超标
甜味超标 2020-12-12 20:03

I am creating an Android app that uses Facebook SSO to login and I\'m not sure how to authenticate with my own webservices after I login to FB. When a user first opens my a

相关标签:
2条回答
  • 2020-12-12 20:27

    Facebook SSO returns an access token. If you'd like, you can pass that along to your server and your server can make a call to the Facebook APIs to check that it's a valid access token for that user (eg by calling https://graph.facebook.com/me?access_token=ACCESS_TOKEN) -- if it is, you're good and have verified that the user is who they say they are (or is a hacker with enough access to have a valid auth token for your app for Facebook, at which point their identity has been compromised on Facebook's end).

    0 讨论(0)
  • 2020-12-12 20:29

    I think you have to pass a password along with your basic info upon profile creation. All in all, the Facebook SSO only gives your client application the right to access the profile user, but it does not garantee your web services that the caller is the actual owner of this FB account. I am afraid that subsequent calls from the Android client to the web service needs to be authenticated via a normal user/name password ( different from the FB account ) if you want to be sure that the caller is the one who retrieved the key the first time ( no matter what Facebook profile he might be linked to ).

    0 讨论(0)
提交回复
热议问题