DartBridgeAuth class
Authentication bridge for C++ auth operations.
Matches Swift's CppBridge+Auth.swift.
C++ handles:
- Token expiry/refresh logic
- JSON building for auth requests
- Auth state management
Dart provides:
- Secure storage (via flutter_secure_storage)
- HTTP transport for auth requests
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
authenticate(
{required String apiKey, required String deviceId, String? buildToken}) → Future< AuthResult> - Authenticate with API key Returns auth response with tokens
-
clearAuth(
) → Future< void> - Clear all auth state
-
getAccessToken(
) → String? - Get current access token
-
getDeviceId(
) → String? - Get device ID
-
getOrganizationId(
) → String? - Get organization ID
-
getRefreshTokenAsync(
) → Future< String?> - Get refresh token asynchronously from secure storage
-
getUserId(
) → String? - Get user ID
-
getValidToken(
) → Future< String?> - Get valid access token, refreshing if needed
-
isAuthenticated(
) → bool - Check if authenticated
-
needsRefresh(
) → bool - Check if token needs refresh
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshToken(
) → Future< AuthResult> - Refresh access token
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → DartBridgeAuth
-
final
Static Methods
-
initialize(
{required SDKEnvironment environment, String? baseURL}) → Future< void> - Initialize auth manager with secure storage callbacks
-
reset(
) → void - Reset auth manager