promptModelRequestConsent

suspend fun promptModelRequestConsent(requester: Requester, trustMetadata: TrustMetadata?, credentialPresentmentData: CredentialPresentmentData, preselectedDocuments: List<Document>, onDocumentsInFocus: (documents: List<Document>) -> Unit): CredentialPresentmentSelection?

A ShowConsentPromptFn which calls PromptModel.requestConsent on the PromptModel in the current coroutine scope.

Return

null if the user dismissed the prompt, otherwise a CredentialPresentmentSelection object conveying which credentials the user selected, if multiple options are available.

Parameters

requester

the relying party which is requesting the data.

trustMetadata

TrustMetadata conveying the level of trust in the requester, if any.

credentialPresentmentData

the combinations of credentials and claims that the user can select.

preselectedDocuments

a list of documents the user may have preselected earlier (for example an OS-provided credential picker like Android's Credential Manager) or the empty list if the user didn't preselect.

onDocumentsInFocus

called with the documents currently selected for the user, including when first shown. If the user selects a different set of documents in the prompt, this will be called again.

Throws

if coroutineContext does not have PromptModel.

if the UI layer hasn't bound any UI for PromptModel.