android-credentials
android-credentials copied to clipboard
Use with facebook SDK
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.
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.
- 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.
- Save a Credential to the API that just has the user's name/email and "Facebook" as the account type.
- 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?
- Users will not have to see your whole login flow on every device.
- 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.
- For providers that support some sort of "silent" sign-in option (like Google) you can get zero-click cross-device sign-in.
I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!