SolidSignInClient

Manages sign-in authorization between a third-party app and the host app.

Obtain an instance via Solid.getSignInClient. All operations require the host app, Solid Share, to be installed on the device; see Solid.isHostInstalled.

Typical flow:

  1. Call getAccount — null means the app holds no grant for that WebID yet.

  2. Launch AuthorizeWithSolid from your Activity to let the user grant access, optionally with an com.erfangholami.androidsolidservices.shared.model.grant.AccessRequest that says what the app needs.

  3. Use disconnectFromSolid to give the grant back when the user signs out.

Every operation is a suspend function that waits for the IPC binding, so there is no need to collect authServiceConnectionState before calling; the flow is there for UI that wants to show the connection.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Hot Flow of the IPC service connection state. Emits true once the bound service connects and false if it disconnects.

Link copied to clipboard
suspend fun disconnectFromSolid(webId: String): Boolean

Gives back this app's grant for webId. Returns true when the host recorded the revocation; the app's next call as that WebID then fails with SolidException.SolidResourceException.NotPermissionException.

Link copied to clipboard
suspend fun getAccount(webId: String): SolidSignInAccount?

Returns the SolidSignInAccount this app holds for webId, carrying the grant the user approved, or null when the app holds no grant for that account.