Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I imagine I should send the OAuth token when making the call to the server. Any examples out there that could help me get started?

Thanks for any pointers.

like image 647
Thomas Avatar asked Apr 12 '11 11:04

Thomas


People also ask

Does OAuth2 support Facebook?

OAuth2 won a standards battle a few years ago. It's the only authentication protocol supported by the major vendors. Google recommends OAuth2 for all of its APIs, and Facebook's Graph API only supports OAuth2. The best way to understand OAuth2 is to look at what came before it and why we needed something different.

How do I set up OAuth on Facebook?

In the App Dashboard, choose your app and scroll to Add a Product Click Set Up in the Facebook Login card. Select Settings in the left side navigation panel and under Client OAuth Settings, enter your redirect URL in the Valid OAuth Redirect URIs field for successful authorization.

Does Facebook login use OAuth?

OAuth is also used when giving third-party apps access to accounts like your Twitter, Facebook, Google, or Microsoft accounts. It allows these third-party apps access to parts of your account. However, they never get your account password.


1 Answers

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. Server tries to get users email address using the token. If the email addresses match, the user has authenticated.

like image 100
tasomaniac Avatar answered Oct 15 '22 00:10

tasomaniac