validateAuthnResponse

suspend fun validateAuthnResponse(input: String): KmmResult<AuthnResponseResult>(source)

Validates an Authentication Response from the Wallet, where input is either:

  • a URL, containing parameters in the fragment, e.g. https://example.com#id_token=...

  • a URL, containing parameters in the query, e.g. https://example.com?id_token=...

  • parameters encoded as a POST body, e.g. id_token=...&vp_token=...

Succeeds if the response has been processed, see AuthnResponseResult: it is a presentation (AuthnResponseResult.Success, valid or not) or an authorization error response of the wallet (AuthnResponseResult.Error). Either one ends the request, so a second response to it fails. Fails if the response has not been processed, i.e. it is malformed, can't be correlated with a request, or violates the protection its request requires.

For the response modes direct_post and direct_post.jwt, answer a processed response with directPostHttpResponse (OpenID4VP 1.0, 8.2), and one that has not been processed with a non-success status, e.g. 400.


Validates an Authentication Response from the Wallet, in case it has been parsed into ResponseParametersFrom with ResponseParser.

See validateAuthnResponse for the outcomes.