retrieveCredentials

suspend fun retrieveCredentials(activity: Activity, credentialOffer: DiscoveredCredentialOffer, clientId: String, redirectUri: String, autoTrustMobileCredentialIaca: Boolean = false): List<RetrieveCredentialResult>

Retrieve credentials from a credential offer according to the authorization process defined by OIDC4VCI - Authorization code flow

Parameters

activity

An Android Activity from where this function is called. The Context is needed for showing a browser with user consent form as well as for biometric user authentication, which is used in the device key generation flow.

credentialOffer

CredentialOffer returned from discoverCredentialOffer

clientId

Client Id of the credentialIssuer

redirectUri

used to successfully redirect the user back to the app after authorization

autoTrustMobileCredentialIaca

optional parameter allowing the automatic download and storage of the issuers IACA certificate if it is available in the issuers metadata. Defaults to false.

Throws

If the SDK API is called before the SDK is initialised.

If generating authorization url has failed.

If AuthorizationCode is not returned

If TokenService call failed.

If the token type is unsupported.

If there is a connectivity issue while requesting the authorisation object.

If deviceKey generation fails.

If the user has not set up authentication.

If the user cancels the authentication process.

If biometric authentication is locked out.

For general authentication failures.

If the IACA certificate download fails.