Mobile biometric auth expert

From curiositech/windags-skills · View interactive version

Mobile biometric auth expert is an AI agent skill from the GitHub repository curiositech/windags-skills. Mobile biometric authentication expert for Face ID, Touch ID, BiometricPrompt, Keychain/Keystore, and WebAuthn. Activate on: biometric authentication, Face ID, Touch ID, BiometricPrompt, Keychain, Keystore, WebAuthn, passkeys, FIDO2, device authentication. NOT for: OAuth/OIDC flows (use oauth-oidc-i

How to use this skill

Skill file

Mobile Biometric Auth Expert

Expert in implementing biometric authentication with Face ID, Touch ID, Android BiometricPrompt, secure credential storage, and Passkeys/WebAuthn.

Decision Points

Biometric Availability Check:

If biometric hardware available AND enrolled:
  → Offer biometric as primary auth
If biometric hardware available BUT not enrolled:
  → Show enrollment prompt + fallback to password
If biometric hardware unavailable:
  → Use password/PIN only, hide biometric UI

Special cases:
- If user declined biometric permission: Store preference, don't re-prompt
- If biometric lockout (too many failures): Force device PIN, then re-enable

Authentication Flow Selection:

If first login on device:
  → Password auth → store token in secure storage → enable biometric gate
If returning user with stored credential:
  → Biometric prompt → decrypt stored token → validate/refresh if needed
If biometric prompt times out (>30s):
  → Show "Use Password" option → device PIN fallback
If biometric enrollment changed:
  → Invalidate stored credentials → require re-authentication

Storage Strategy:

If iOS:
  → Keychain with kSecAccessControlBiometryCurrentSet
If Android API 23+:
  → Keystore with setUserAuthenticationRequired(true)
If cross-platform framework:
  → Expo SecureStore or RN Keychain with biometric access control

Passkey vs Biometric-Gated Token:

If WebAuthn/Passkey supported AND user has existing account:
  → Offer passkey upgrade (future-proof, no token storage)
If new user registration:
  → Default to passkey flow, fallback to biometric-gated tokens
If enterprise/MDM environment:
  → Check policy for passkey allowlist before offering

Failure Modes

Rubber Stamp Biometric - Using biometric UI without secure storage

Enrollment Invalidation Blind Spot - Ignoring biometric enrollment changes

Fallback Chain Break - No recovery path when biometrics fail

Prompt Fatigue - Biometric prompts for low-value actions

Custom UI Trust Gap - Building custom biometric interfaces

Worked Examples

Passkey Implementation with Biometric Fallback:

// 1. Check WebAuthn support
guard ASAuthorizationPlatformPublicKeyCredentialProvider.isSupported else {
    // Fall back to biometric-gated token storage
    return authenticateWithStoredToken()
}

// 2. Create passkey request
let challenge = Data("server-challenge".utf8)
let request = ASAuthorizationPlatformPublicKeyCredentialProvider
    .createCredentialRegistrationRequest(
        challenge: challenge,
        name: "user@example.com",
        userID: Data("user-123".utf8)
    )

// 3. Handle success/failure
func authorizationController(controller: ASAuthorizationController, 
                           didCompleteWithAuthorization authorization: ASAuthorization) {
    if let credential = authorization.credential as? ASAuthorizationPlatformPublicKeyCredentialRegistration {
        // Passkey created - store credential ID, send public key to server
        storeCredentialID(credential.credentialID)
        sendPublicKeyToServer(credential.rawAttestationObject)
    }
}

// 4. Graceful degradation
func authorizationController(controller: ASAuthorizationController, 
                           didCompleteWithError error: Error) {
    if case ASAuthorizationError.canceled = error {
        // User canceled - offer biometric-gated password login
        showBiometricPasswordFallback()
    }
}

Trade-offs navigated:

Quality Gates

NOT-FOR Boundaries

Use other skills for:

This skill handles: Device-level biometric authentication, secure credential storage, WebAuthn/Passkey implementation, and biometric UX flows only.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.