Best of sign in experience @ Droidcon Lisbon

Best of sign in experience @ Droidcon Lisbon

6032346e0ffefcdd8adfdb734ae91d92?s=128

Dmytro Khmelenko

September 10, 2019
Tweet

Transcript

  1. Best of sign in experience Dmytro Khmelenko Software Engineer @

    Freeletics
  2. How often did you have to do login in apps?

    !2
  3. !3

  4. !4

  5. !5

  6. !6

  7. !7

  8. !8

  9. !9

  10. !10

  11. Why? • Privacy • Personalised content

  12. Solutions

  13. Log in with Facebook 2.3 billion monthly active users on

    Facebook
  14. Log in with Google

  15. None
  16. Distribution (Android)

  17. Distribution (iOS)

  18. oAuth

  19. oAuth

  20. Solution

  21. Firebase Has sign in pre-built UI
 
 
 


  22. Firebase https://github.com/firebase/FirebaseUI-Android

  23. Firebase Has sign in pre-built UI Supports multiple providers
 


  24. Firebase

  25. Firebase Has sign in pre-built UI Supports multiple providers Has

    account management
 

  26. Firebase

  27. Firebase Has sign in pre-built UI Supports multiple providers Has

    account management Anonymous access & account linking 

  28. Firebase Has sign in pre-built UI Supports multiple providers Has

    account management Anonymous access & account linking Full email sign up support
  29. Firebase

  30. Firebase: Good to know •Usage limits •Extending with Cloud Functions

    •Accounts import/export
  31. Classic Email log in

  32. What’s wrong You have to type You need to remember

    The password has to contain at least N characters. At least one character must be a number or a special character.
  33. Autofill framework https://developer.android.com/guide/topics/text/autofill <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:autofillHints="password" />

  34. None
  35. SmartLock for Passwords https://developers.google.com/identity/smartlock-passwords/android/

  36. SmartLock for Passwords • Increase in conversion rate • Significant

    drop in register and sign in failures https://developers.google.com/identity/smartlock-passwords/case-studies
  37. How to Auth.CredentialsApi.save(mCredentialsClient, credential).setResultCallback( new ResultCallback() { @Override public void

    onResult(Status status) { if (status.isSuccess()) { // Credentials were saved } else { if (status.hasResolution()) { try { status.startResolutionForResult(this, RC_SAVE); } catch (IntentSender.SendIntentException e) { // Could not resolve the request } } } } });
  38. RxSmartLock https://github.com/freeletics/RxSmartLock • Saving
 RxGoogleSmartLockManager.storeCredentials(context, credentials).subscribe()

  39. None
  40. RxSmartLock https://github.com/freeletics/RxSmartLock • Saving
 RxGoogleSmartLockManager.storeCredentials(context, credentials).subscribe() • Restoring
 RxGoogleSmartLockManager.retrieveCredentials(context).subscribe()

  41. None
  42. RxSmartLock https://github.com/freeletics/RxSmartLock implementation 'com.freeletics.rxsmartlock:rxsmartlock:1.0.2'

  43. Fingerprint API • Secure • Fast • Easy

  44. Fingerprint API: requirements • From API 26 • Fingerprint sensor

    • Enabled Lock screen • Registered fingerprints • Grant permissions
  45. Fingerprint API: with prompt val callback = object: BiometricPrompt.AuthenticationCallback() {

    override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult?) { super.onAuthenticationSucceeded(result) } override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) { super.onAuthenticationError(errorCode, errString) } } val prompt = BiometricPrompt.Builder(context) .setTitle(“Login") .setDescription("Use fingerprint to login") .setNegativeButton("Cancel", { }, { dialog, i -> }) .build() prompt.authenticate(CancellationSignal(), mainExecutor, callback) https://android-developers.googleblog.com/2018/06/better-biometrics-in-android-p.html API 28
  46. Fingerprint API: with prompt val callback = object: BiometricPrompt.AuthenticationCallback() {

    override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult?) { super.onAuthenticationSucceeded(result) } override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) { super.onAuthenticationError(errorCode, errString) } } val prompt = BiometricPrompt.Builder(context) .setTitle(“Login") .setDescription("Use fingerprint to login") .setNegativeButton("Cancel", { }, { dialog, i -> }) .build() prompt.authenticate(CancellationSignal(), mainExecutor, callback) https://android-developers.googleblog.com/2018/06/better-biometrics-in-android-p.html API 28
  47. API 28

  48. Fingerprint API: how to val callback = object: FingerprintManagerCompat.AuthenticationCallback() {

    override fun onAuthenticationError(errMsgId: Int, errString: CharSequence?) { super.onAuthenticationError(errMsgId, errString) } override fun onAuthenticationSucceeded( result: FingerprintManagerCompat.AuthenticationResult?) { super.onAuthenticationSucceeded(result) } } val fingerprintManager = FingerprintManagerCompat.from(context!!) fingerprintManager.authenticate(null, 0, CancellationSignal(), callback, null) https://developer.android.com/reference/android/support/v4/hardware/fingerprint/FingerprintManagerCompat
  49. Fingerprint API: how to val callback = object: FingerprintManagerCompat.AuthenticationCallback() {

    override fun onAuthenticationError(errMsgId: Int, errString: CharSequence?) { super.onAuthenticationError(errMsgId, errString) } override fun onAuthenticationSucceeded( result: FingerprintManagerCompat.AuthenticationResult?) { super.onAuthenticationSucceeded(result) } } val fingerprintManager = FingerprintManagerCompat.from(context) fingerprintManager.authenticate(null, 0, CancellationSignal(), callback, null) https://developer.android.com/reference/android/support/v4/hardware/fingerprint/FingerprintManagerCompat
  50. https://github.com/googlesamples/android-FingerprintDialog

  51. Happy users must have you

  52. @dkhmelenko