SolidAuthReceiver class

Solid authentication provider for worker isolate/thread.

Receives DPoP credentials from main thread via WorkerChannel and generates DPoP tokens locally for each HTTP request. This architecture ensures:

  • Fresh tokens: DPoP tokens generated immediately before each request
  • Security: Private key operations stay in worker where HTTP happens
  • Performance: No serialization overhead per request (credentials sent once)
  • State sync: isAuthenticatedNotifier triggers backend initialization

Lifecycle

  1. Created via SolidAuthConnector.receiver in worker entry point
  2. Listens to WorkerChannel for UpdateAuthMessage
  3. Updates internal _credentials and _webId
  4. Notifies listeners via isAuthenticatedNotifier
  5. SolidBackend reacts by initializing remote storage

Usage

void workerEntryPoint() {
  startWorkerIsolate((context) async {
    final authProvider = SolidAuthConnector.receiver(context);
    final backend = SolidBackend(auth: authProvider);
    // Backend now reacts to auth state changes automatically
  });
}

Constructors

SolidAuthReceiver(WorkerHandlerChannel _channel)
Creates provider that listens to channel for authentication updates.

Properties

currentWebId String?
Current authenticated user's WebID.
no setter
hashCode int
The hash code for this object.
no setterinherited
isAuthenticatedNotifier → AuthValueListenable
Listenable for authentication state changes.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userDisplayName String?
no setter

Methods

getDpopToken(String url, String method) Future<({String accessToken, String dPoP})>
Generates DPoP token for authenticated HTTP request.
isAuthenticated() Future<bool>
Whether currently authenticated.
logout() Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshToken({String? reason}) Future<void>
Requests fresh credentials from main thread.
toString() String
A string representation of this object.
inherited

Operators

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