ZenithIdentityCoordinator class

Coordinates the full identity lifecycle for a mobile application.

Manages authentication state transitions, anonymous account linking, biometric fast-lock, and back-channel revocation. Internally owns a ZenithScopeManager so that each identity has a fully isolated container.

final coordinator = ZenithIdentityCoordinator();
await coordinator.signInAnonymously(anonId: 'anon_123');
await coordinator.upgradeAnonymousAccount(
  newSession: 'user_456',
  onMigrate: (from, to) async { /* copy cart, etc. */ },
);

Constructors

ZenithIdentityCoordinator()

Properties

currentScope → ZenithTenantScope?
The currently active ZenithTenantScope, or null if unauthenticated.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → ZenithAuthState
The current authentication state.
no setter

Methods

addListener(void listener()) → void
Registers a callback to be notified when the authentication state changes.
hasScope(String id) → bool
Returns whether a scope with id exists in the internal scope manager.
ingestRemoteRevocation({required String tenantId, required RevocationReason reason}) → Future<void>
Ingests a remote revocation signal for tenantId, terminating the session and notifying all registered revocation listeners.
lockSession() → void
Locks the current session for biometric re-authentication.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSecurityRevocation(void listener(RevocationReason reason)) → void
Registers listener to be called when a remote revocation is received.
removeListener(void listener()) → void
Unregisters a previously registered callback.
signIn<T>(T session, {String? tenantId}) → Future<void>
Signs in using an explicit stable tenant ID. String sessions may be used directly as IDs for compatibility; objects must supply tenantId.
signInAnonymously({required String anonId}) → Future<void>
Signs in as an anonymous guest and retires the prior identity.
signOut() → Future<void>
Clears identity immediately and awaits pending resource teardown.
toString() → String
A string representation of this object.
inherited
unlockSession() → Future<void>
Unlocks a locked session, restoring the prior authenticated state.
upgradeAnonymousAccount<T>({required T newSession, String? tenantId, required Future<void> onMigrate(ZenithContainer fromContainer, ZenithContainer toContainer)}) → Future<void>
Upgrades an anonymous session to a fully authenticated one.

Operators

operator ==(Object other) → bool
The equality operator.
inherited