/iOSBiometricLogin

Sample iOS app to demonstrate login using biometrics.

Primary LanguageSwiftMIT LicenseMIT

Biometric Logins

IDE Platform Language License

A sample iOS app to demonstrate logins using biometrics (Face ID/Touch ID) available.

Face ID Touch ID
Face ID Touch ID

Features

  1. Written in CleanSwift architecture
  2. A login page to fallback from biometrics authentication failure
  3. A biometrics page to authenticate using biometrics
  4. A dashboard page providing the capability to enable/disable biometrics login
  5. A BiometricsWorker.swift that does all the work to authenticate using Face ID/Touch ID

Biometrics Worker

  • Handles the 3 common use-cases in biometrics authentication:
  1. Success
    • Biometrics authentication is successful
    • Routes user to Dashboard
  2. Cancel
    • User cancels biometrics authentication
    • Routes user back to welcome screen
  3. Error
    • Biometrics authentication unsuccessful due to any possible reason
    • Routes user to Fallback page (Login)

Protips/Pitfalls

  1. In info.plist file, add a description to the key Privacy - Face ID Usage Description. This will be the localizedDescription for Face ID (as you may have already set for Touch ID) and it will suppress any 'app not updated to handle Face ID' messages.
  2. LocalAuthentication framework is used to handle both Face ID and Touch ID.