https://github.com/praneetneuro/authxkit
Swift package for using biometric authentication services for iOS, iPadOS and macOS in a simple and elegant way
https://github.com/praneetneuro/authxkit
authentication biometric-authentication faceid ios ipados macos passcode password swift touchid
Last synced: about 1 month ago
JSON representation
Swift package for using biometric authentication services for iOS, iPadOS and macOS in a simple and elegant way
- Host: GitHub
- URL: https://github.com/praneetneuro/authxkit
- Owner: PraneetNeuro
- License: mit
- Created: 2021-06-01T13:09:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-01T15:33:49.000Z (almost 4 years ago)
- Last Synced: 2025-03-27T13:45:34.943Z (about 2 months ago)
- Topics: authentication, biometric-authentication, faceid, ios, ipados, macos, passcode, password, swift, touchid
- Language: Swift
- Homepage:
- Size: 15.6 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AuthxKit
Swift package for using biometric authentication services for iOS, iPadOS and macOS in a simple and elegant way## Check if device has support for biometric authentication
```swift
import AuthxKitif AuthxKit.shared.canUseBiometrics {
// Do something
} else {
// Fallback
}
```
### Use biometric authentication
Note: To use FaceID: add the key "Privacy - Face ID Usage Description" to your app's info.plist
```swift
import AuthxKitAuthxKit.shared.authenticateUsingBiometrics(authenticationMessage: "Perform biometric authentication to proceed", completion: {
isAuthenticated, _ in
if isAuthenticated {
// Perform action awaiting authentication
} else {
// Perform action in case of failed authentication
}
})
```
### Use Apple Watch authentication (only available for macOS)
```swift
import AuthxKitAuthxKit.shared.authenticateUsingWatch(authenticationMessage: "Perform authentication using Apple Watch") {
isAuthenticated, error in
if isAuthenticated {
// Perform action awaiting authentication
} else {
// Perform action in case of failed authentication
}
}
```
### Use password / passcode authentication
```swift
import AuthxKitAuthxKit.shared.authenticateUsingUserSetSecretKey(authenticationMessage: "Perform authentication using password / passcode") {
isAuthenticated, error in
if isAuthenticated {
// Perform action awaiting authentication
} else {
// Perform action in case of failed authentication
}
}
```