OpenId4VciKtorClient
Implements the client side of OpenID for Verifiable Credential Issuance 1.0 from 2025-09-16 with ktor, by sending the requests of OpenId4VciProtocolClient and at.asitplus.wallet.lib.oauth2.OAuth2ProtocolClient, which implement the protocols, in the order of each flow. Supported features:
Pre-authorized grants
Authentication code flows
Constructors
Functions
Loads credential metadata info from host, call parseCredentialMetadata to parse it, returns a list of CredentialIdentifierInfo.
Loads the CredentialOffer from input, i.e. the content of a QR code or deep link: a JSON-encoded credential offer, or a credential offer URL with the offer embedded (credential_offer) or passed by reference (credential_offer_uri), which will be loaded from the credential issuer.
Loads some user-selected credentials with pre-authorized code from the OID4VCI credential issuer, with one token for all of them, as a pre-authorized code can usually be used only once
Loads a user-selected credential with pre-authorized code from the OID4VCI credential issuer
Loads the metadata of credentialIssuer, preferring signed metadata, which are validated under policy, see OpenId4VciProtocolClient.loadIssuerMetadata. Pass them to parseCredentialMetadata, if the wallet accepts them, so that every CredentialIdentifierInfo carries the validated credential issuer.
Parses IssuerMetadata and returns a list of CredentialIdentifierInfo.
Parses the metadata of loaded, see loadIssuerMetadata, and returns a list of CredentialIdentifierInfo, each with the credential issuer validated from signed metadata. Fails for signed metadata that have been rejected.
Parses the metadata of loaded also if signed metadata have been rejected, without a validated credential issuer, see OpenId4VciProtocolClient.parseCredentialMetadataIgnoringTrust: only to continue after showing the report to the user.
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).
Called after getting the redirect back from the authorization server to the credential issuer.
Starts the issuing process at credentialIssuerUrl for all of credentialIdentifierInfos with one authorization, like the overload for one credential, so that the user authenticates only once.
Starts the issuing process at credentialIssuerUrl. Clients need to handle the result, i.e. open the URL for user authentication or store the credentials, see CredentialIssuanceResult.Success.prepareCredentialStorage. 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 oid4vciClient) after the browser being redirecting back from the authorization server.