JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 859507
  • Score
    100M100P100Q231271F
  • License MIT

DPoP for the browser

Package Exports

  • dpop

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dpop) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

DPoP for the browser

Implementation of https://tools.ietf.org/html/draft-fett-oauth-dpop-04

Requires WebCrypto API

Supports the following JWS algorithms: PS256, PS384, PS512, RS256, RS384, RS512, ES256, ES384, ES512

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
  </head>

  <script type="module">
    import DPoP, { generateKeyPair } from 'https://cdn.jsdelivr.net/npm/dpop@^0.5.0'

    (async () => {
      const alg = 'ES256'
      const keypair = await generateKeyPair(alg)
      const dpopToken = await DPoP(keypair, alg, 'https://rs.example.com/resource', 'GET')
    })()
  </script>
</html>

Storage of the keypair is not included, use your existing abstraction over IndexedDB to store the keypair instances.