OpenId4VciClient

class OpenId4VciClient(engine: HttpClientEngine, cookiesStorage: CookiesStorage? = null, httpClientConfig: HttpClientConfig<*>.() -> Unit? = null, oid4vciService: WalletService = WalletService(), oauth2InternalClient: OAuth2Client = OAuth2Client(clientId = oid4vciService.clientId), oauth2Client: OAuth2KtorClient = OAuth2KtorClient( engine = engine, cookiesStorage = cookiesStorage, httpClientConfig = httpClientConfig, oAuth2Client = oauth2InternalClient, ))(source)

Implements the client side of OpenID for Verifiable Credential Issuance 1.0 from 2025-09-16. Supported features:

Constructors

Link copied to clipboard
constructor(engine: HttpClientEngine, cookiesStorage: CookiesStorage? = null, httpClientConfig: HttpClientConfig<*>.() -> Unit? = null, oid4vciService: WalletService = WalletService(), oauth2InternalClient: OAuth2Client = OAuth2Client(clientId = oid4vciService.clientId), oauth2Client: OAuth2KtorClient = OAuth2KtorClient( engine = engine, cookiesStorage = cookiesStorage, httpClientConfig = httpClientConfig, oAuth2Client = oauth2InternalClient, ))

Functions

Link copied to clipboard

Loads credential metadata info from host, parses it, returns list of CredentialIdentifierInfo.

Link copied to clipboard
suspend fun loadCredentialWithOfferReturningResult(credentialOffer: CredentialOffer, credentialIdentifierInfo: CredentialIdentifierInfo, transactionCode: String? = null): KmmResult<CredentialIssuanceResult>

Loads a user-selected credential with pre-authorized code from the OID4VCI credential issuer

Link copied to clipboard

Call to refresh a credential with a stored refresh token (that was received when issuing the credential for the first time, as returned in CredentialIssuanceResult.Success.refreshToken).

Link copied to clipboard

Called after getting the redirect back from the authorization server to the credential issuer.

Starts the issuing process at credentialIssuerUrl. Clients need to handle the result, i.e. open the URL for user authentication or store the credentials. Clients need to call resumeWithAuthCode after getting the authorization code back from the authorization server, e.g. by the Wallet app getting opened (see redirectUrl at oid4vciService) after the browser being redirecting back from the authorization server.