Parse and verify an OID4VP Authorization Request the wallet receives
(draft-ietf-oauth-openid4vp §5) - the holder-side mirror of
Attesto.PresentationRequest.build/1.
The verifier's request arrives as a signed request object (JAR, RFC 9101):
by value, in the deep link's request parameter, or by reference, in its
request_uri parameter. Both forms are signed; only the transport differs
verify/3handles the former,fetch/3GETs the JWT (throughAttestoClient.OAuthHTTP.get_text/2, so it is mockable the same way as the rest of this library) and then callsverify/3. Signature verification delegates entirely toAttesto.RequestObject.verify_with_claims/3, sotrustedandoptsbehave exactly as there (e.g.:audience,:accepted_algs,:accepted_typ).
Only response_type=vp_token and response_mode=direct_post /
direct_post.jwt are recognised (OID4VP §5, §8.2). direct_post.jwt
parses successfully - the request is reported faithfully - but
AttestoClient.Wallet.Presentation does not build a response for it yet
(encrypted responses are a follow-up).
Summary
Functions
Fetch a by-reference request object from request_uri and verify it.
Verify a signed OID4VP Authorization Request object (a by-value request
JWT) and return its parsed parameters.
Types
@type error() :: :invalid_response_type | :invalid_response_mode | :invalid_client_id | :invalid_nonce | :invalid_response_uri | :invalid_dcql_query | :invalid_state | Attesto.RequestObject.verify_error()
Functions
@spec fetch(String.t(), map() | [map()], Attesto.RequestObject.verify_opts()) :: {:ok, t()} | {:error, term()}
Fetch a by-reference request object from request_uri and verify it.
Options are shared between the fetch (AttestoClient.OAuthHTTP.get_text/2
:req_options,:timeout) and the verification (verify/3-trusted,RequestObject.verify_opts); each side reads only the options it recognises.
@spec verify(String.t(), map() | [map()], Attesto.RequestObject.verify_opts()) :: {:ok, t()} | {:error, error()}
Verify a signed OID4VP Authorization Request object (a by-value request
JWT) and return its parsed parameters.