PasskeyError

sealed class PasskeyError

Every way a passkey operation can fail, across all platforms. fixHint is non-null when a developer can fix the cause (configuration, options). checkId names the setup check from the PassKi check catalog that covers the cause, the same ID PasskeyDoctor, ./gradlew passkiCheck and the web verifier report, and docsUrl links its docs page.

Open: new subtypes may be added in minor releases; keep an else branch in exhaustive whens.

Inheritors

Types

Link copied to clipboard

A passkey from the options' excludeCredentials already exists on this device. Not reported below iOS 17.4, which ignores excludeCredentials.

Link copied to clipboard
data object Cancelled : PasskeyError

The user dismissed the passkey sheet. Usually not worth showing an error for.

Link copied to clipboard

The request didn't run to the end, and nothing is wrong with it: the system interrupted it (e.g. the app went to the background), or another PassKi passkey request was still showing (only one runs at a time). Safe to retry; don't show it to users as a failure.

Link copied to clipboard

The options JSON passed in was malformed or invalid. See fixHint; checkId is CFG-01 for a bad RP ID.

Link copied to clipboard
class Misconfigured(val message: String, val fixHint: String, val checkId: String?) : PasskeyError

The app or its environment is set up incorrectly (e.g. missing asset links). See fixHint and docsUrl.

Link copied to clipboard

No matching passkey is available on this device. Offer another sign-in method.

Link copied to clipboard
class NotSupported(val message: String) : PasskeyError

The device, OS or platform does not support the requested operation.

Link copied to clipboard
class Unknown(val message: String, val platformCode: String?, val cause: Throwable? = null) : PasskeyError

Any failure PassKi could not classify.

Properties

Link copied to clipboard

What kind of failure this is, for deciding what to show. The set of categories is closed, so a when over it needs no else; a new error type always joins an existing category.

Link copied to clipboard
open val checkId: String?

The catalog check that covers this error (e.g. AND-03, IOS-02, CFG-01), or null when no setup check does. Run PasskeyDoctor or ./gradlew passkiCheck to see which part of that check fails.

Link copied to clipboard

The docs page for checkId: what the check means and how to fix it. Null when checkId is null.

Link copied to clipboard
open val fixHint: String?

What a developer should change to fix this error, or null when it is not actionable.

Link copied to clipboard

True when the user ended the request or it was interrupted (Cancelled, Interrupted): show no error.

Link copied to clipboard
abstract val message: String

Human-readable description, suitable for logs.