antlion-lacewing - v2.0.1
    Preparing search index...

    Function verifyDPoPRequest

    • Verify the access token, the DPoP proof and the binding between them, or throw. There is no partial result and no way to check a proof alone.

      A refusal is an AntlionError whose refusal holds the status and headers to send. Its code is for your logs; the client learns only what RFC 9449 says it may.

      Parameters

      Returns Promise<DPoPVerifiedJwt>

      try {
      const { token, nextNonce } = await verifyDPoPRequest(request, dpop);
      // token.payload.sub, ...
      } catch (error) {
      if (error instanceof AntlionError && error.refusal !== undefined) {
      return new Response(null, error.refusal);
      }
      throw error;
      }