android-credentials icon indicating copy to clipboard operation
android-credentials copied to clipboard

Use with facebook SDK

Open mypplication opened this issue 10 years ago • 2 comments

Hello, I see that this API supports Facebook. But how to properly use with it? there have no technique to connect in "silent" with the Facebook SDK. Can you explain how we should use it ?

Thank you.

mypplication avatar Dec 28 '15 11:12 mypplication

The intended usage of the Credentials API for non-password authentication (Google Sign-In, Facebook Log In, etc) is as a sort of "hint".

Imagine this scenario.

  1. A user gets your app on device A. She is presented with a screen with Facebook, Google, and Twitter login buttons. The user choose Facebook.
  2. Save a Credential to the API that just has the user's name/email and "Facebook" as the account type.
  3. The same user gets a second device (a tablet, for instance) and downloads your app again. To your app this is a brand new user, but the Credentials API will recognize the user and return the Facebook credential. This means you can skip the login screen and pretend that the user hit the Facebook sign-in button since you know that is their preference (or show a screen with just that option, to reduce confusion).

What are the benefits of this?

  1. Users will not have to see your whole login flow on every device.
  2. Users will not forget which identity option they chose, which will make their life easier and make it more likely that you can recognize users across devices.
  3. For providers that support some sort of "silent" sign-in option (like Google) you can get zero-click cross-device sign-in.

samtstern avatar Jan 04 '16 23:01 samtstern

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!

codingjeremy avatar Sep 10 '19 21:09 codingjeremy