Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Best of sign in experience @ Droidcon Lisbon

Best of sign in experience @ Droidcon Lisbon

Dmytro Khmelenko

September 10, 2019
Tweet

More Decks by Dmytro Khmelenko

Other Decks in Technology

Transcript

  1. !3

  2. !4

  3. !5

  4. !6

  5. !7

  6. !8

  7. !9

  8. !10

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

    account management Anonymous access & account linking 

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

    account management Anonymous access & account linking Full email sign up support
  11. 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.
  12. SmartLock for Passwords • Increase in conversion rate • Significant

    drop in register and sign in failures https://developers.google.com/identity/smartlock-passwords/case-studies
  13. 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 } } } } });
  14. Fingerprint API: requirements • From API 26 • Fingerprint sensor

    • Enabled Lock screen • Registered fingerprints • Grant permissions
  15. 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
  16. 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
  17. 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
  18. 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