CtrlAppAuth class abstract

The public auth client.

Implementers

Constructors

CtrlAppAuth({required CtrlAppAuthConfig config, required CtrlAppTransport transport})
Compose against a CtrlAppTransport. The transport is the ONLY route to the network; tests pass MockCtrlAppTransport, production passes HttpCtrlAppTransport.
factory
CtrlAppAuth.fake({SessionState? initial})
Deterministic fake for widget/unit tests.
factory

Properties

authStateChanges → Stream<SessionState>
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

Methods

cancel() → void
Cancel an in-flight sign-in: clears the pending verifier/state so a late callback delivery is rejected as cancelled.
dispose() → void
getAssuranceLevel() → Assurance
getAuthStatus() → Future<Map<String, dynamic>>
getSession({bool force = false}) → Future<SessionState>
handleCallback(Uri callbackUri) → Future<SessionState>
Called by your app_links / deep-link handler with the incoming URI. Validates scheme/host/path/state, deduplicates, exchanges the handoff code for a session artifact, emits Authenticated.
hasPermission(String permission) → bool
hasRole(String role) → bool
linkProvider(String provider, {String? returnTo}) → Future<void>
listProviders() → Future<List<AuthProvider>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshSession() → Future<SessionState>
requestStepUp({String? acr, String? returnTo}) → Future<void>
signIn({String? provider, String? returnTo}) → Future<void>
Launch hosted sign-in with PKCE S256 + state + nonce. In mobile mode (default when CtrlAppAuthConfig.callbackUrl is not the BFF origin) generates a code_verifier and sends its S256 challenge to /api/public/auth/login?mobile=1&.... The system browser then hands control to the OS-registered app link which the caller forwards to handleCallback.
signOut({String? returnTo}) → Future<void>
toString() → String
A string representation of this object.
inherited
unlinkProvider(String provider) → Future<bool>

Operators

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