zuraffa_auth_ios

iOS adapter for zuraffa_auth — platform-authorization sign-in (Sign in with Apple-shaped) and Keychain session persistence with a declared accessibility policy, over one injected channel seam.

Pure Dart: the native embedder is a documented method/error protocol, not a dependency.

final channel = IosAuthChannel(invoke: myTransport.invoke);
final auth = AuthService(
  providers: [
    IosCredentialAuthProvider(
      channel: channel,
      context: IosAuthContext(bundleId: 'com.example.app', teamId: 'T34M'),
    ),
  ],
  sessions: IosKeychainSessionStore(
    channel: channel,
    policy: const IosKeychainPolicy.afterFirstUnlock(),
  ),
);
// or:
registerIosAuthDependencies(getIt, channel: channel);

Channel protocol

Method Args Result Errors
authorize identifier, secret, extras, bundleId, teamId token payload + subject, displayName?, email? see below
refreshCredential token fields + context token payload see below
revokeCredential accessToken + context any (best-effort) swallowed
secureWrite key, value (JSON), accessibility any typed
secureRead key {value: String?} typed
secureKeys prefix {keys: [String]} typed
secureDelete key {deleted: bool} typed

Errors arrive as {'error': {'code', 'message'}} payloads (or thrown transport failures → channel_error). Taxonomy: no_credentials → typed invalid_credentials; user_cancelled / biometry_lockout / timeout → recoverable; keychain_unavailable and unknown codes → non-recoverable, preserved verbatim.

Accessibility policy

Every write carries the declared policy (accessibility arg). Known values: whenUnlocked, afterFirstUnlock (default), always. An unknown value is a typed non-recoverable invalid_policy error at the first write — never silently coerced.

Libraries

zuraffa_auth_ios
iOS adapter for zuraffa_auth: platform-authorization sign-in and Keychain session persistence over one injected channel seam.