BiometricAuth 2.0.0

BiometricAuth 2.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Igor Vasilenko.



  • By
  • Igor Vasilenko

Features

  • [x] Force failure authentication if was added new fingerprint to device. This feature for security considerations.
  • [x] Saving features list that’s needs authentication via TouchID

Requirements

  • iOS 9.0+ / macOS 10.12+
  • Xcode 8.1+
  • Swift 4.0+

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Usage

Intro

In security cosiderations strongly recommented enable forceThrowsOnChangedDomainState

let biometricAuth = BiometricAuth(forceThrowsOnChangedDomainState: true)

Biometric authentication availability

do {
    try self.biometricAuth.isAvailable()
} catch let error as BiometricAuthError {
    print(error.localizedDescription)
} catch {
    print("Something went wrong")
}

Feature enabled/disabled for biometric authentication

let feature = "Passcode Screen Auth"

do {
    try self.biometricAuth.enableAuthentication(forFeature: feature)
} catch let error as BiometricAuthError {
    print(error.localizedDescription)
} catch {
    print("Something went wrong")
}

Authenticating

self.biometricAuth.requestAuthentication(forFeature: feature, reason: "Reason", completion: { (result, error) in
    if result {
        print("Success")
    }
})

License

BiometricAuth is released under the MIT license. See LICENSE for details.