IO Wallet SDK
    Preparing search index...

    Function fetchAuthorizationRequest

    • Fetches an OpenID4VP authorization request JWT from a QR code URL.

      Supports two transmission modes:

      • By Value: Request Object JWT passed inline via request parameter
      • By Reference: Request Object JWT fetched from request_uri

      The function:

      1. Parses the authorization URL to extract parameters
      2. Validates that exactly one of request or request_uri is present
      3. Either uses inline JWT or fetches from URI (GET/POST based on request_uri_method)
      4. Returns the Request Object JWT along with transmission mode metadata

      Note: This function does NOT parse or verify the JWT. Use parseAuthorizeRequest separately to decode and optionally verify the signature.

      Returns Promise<FetchAuthorizationRequestResult>

      Promise that resolves to FetchAuthorizationRequestResult

      When required query parameters are missing, the URL is invalid, or an unexpected error occurs during fetch or parsing

      When the server returns a non-200 status code during fetch

      When URL parameters fail schema validation

      const url = "[https://wallet.example.org/authorize](https://wallet.example.org/authorize)?" +
      "client_id=openid_federation%23https%3A%2F%2Frp.example.org" +
      "&request=eyJhbGciOiJFUzI1NiIs...";

      const result = await fetchAuthorizationRequest({
      authorizeRequestUrl: url,
      callbacks: { fetch },
      });
      // result.sendBy === "value"
      // result.requestObjectJwt === "eyJhbGciOiJFUzI1NiIs..."

      Example: By Reference mode with POST

      const url = "[https://wallet.example.org/authorize](https://wallet.example.org/authorize)?" +
      "client_id=openid_federation%23https%3A%2F%2Frp.example.org" +
      "&request_uri=https%3A%2F%2Frp.example.org%2Frequest" +
      "&request_uri_method=post";

      const result = await fetchAuthorizationRequest({
      authorizeRequestUrl: url,
      callbacks: { fetch },
      walletMetadata: {
      authorization_endpoint: "[https://wallet.example.org/authorize](https://wallet.example.org/authorize)",
      response_types_supported: ["vp_token"],
      },
      walletNonce: "random-nonce",
      });
      // result.sendBy === "reference"
      // result.requestObjectJwt === fetched JWT from request_uri