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
window.crypto.subtle.generateKeywindow.crypto.subtle.exportKeywindow.crypto.subtle.signwindow.crypto.getRandomValues
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 './lib/index.mjs'
(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.