Skip to content

iOS: errSecAuthFailed (-25293) is not mapped to an AuthException #128

@dominicmh

Description

@dominicmh

Problem

On iOS, in case of a native errSecAuthFailed error, BiometricStorageFile (read or write) doesn't map the native error to an AuthException. Instead a PlatformException is thrown:

PlatformException(SecurityError, Error while Error retrieving item. -25293: -25293: La phrase secrète ou le nom d’utilisateur saisi n’est pas valide., null, null)

This makes it hard to handle the error properly. It requires parsing the PlatformException's message instead of simply relying on AuthException.

Precondition

This error can occur when StorageFileInitOptions(darwinBiometricOnly: true) and:

  1. A user has set up a BiometricStorageFile with functioning biometrics setup
  2. User changes their biometrics settings, e.g.: Disabling biometrics, removing biometrics permission from app, or adding a fingerprint.
  3. User tries to access the BiometricStorageFile with the new biometrics setup

Expected Behaviour

A new case AuthException.biometricsChanged (or similar) is returned. No exception is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions