Scan your whole stack
Are you using @web-ts-toolkit/oidc-vault-dpop-client?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.78.0
@web-ts-toolkit/oidc-vault-dpop-client was last scanned on 29 Nov 2026 at version 0.78.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.78.0 LATEST | 29 Nov 2026 | No rules fired |
| 0.77.0 | 28 Nov 2026 | No rules fired |
| 0.76.0 | 27 Nov 2026 | No rules fired |
| 0.75.0 | 22 Nov 2026 | Not shown |
| 0.74.0 | 21 Nov 2026 | Not shown |
Findings for v0.78.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.78.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
@web-ts-toolkit/oidc-vault-dpop-clientBrowser-only client for @web-ts-toolkit/express-oidc-vault
vault flows, with body and cookie session transports. DPoP is on by
default (omitted dpop or dpop: true): persistent non-extractable P-256 keys,
per-attempt proofs and bounded nonce/refresh retries. Explicit dpop: false
selects keyless Bearer for the whole session, never automatic fallback.
Both modes use app-local credentials, not IdP access, ID or refresh tokens.
Bearer token theft permits replay; it does not provide DPoP's sender constraint.
The package ships at an es2022 bundle target for modern evergreen browsers
(Chrome 94+, Edge 94+, Firefox 93+, Safari 16+, declared via browserslist).
It touches browser globals (crypto.subtle, indexedDB, sessionStorage,
and — cookie transport only — navigator.locks plus BroadcastChannel) lazily
behind runtime feature asserts, never at module import time. There is no
express, no node:*, and no default export.
Guide: Quickstart · Explicit Bearer · Auto-refresh · Observation · Lifecycle/cleanup · HTTP bounds · Recovery · Gateway scopes · Upgrade notes
pnpm add @web-ts-toolkit/oidc-vault-dpop-client
jose and idb are runtime dependencies of this package, not peers: the
single install above is enough. Do not install them separately unless your own
code imports them directly.
Requirements: DPoP needs secure-context Web Crypto, IndexedDB CryptoKey
persistence and sessionStorage. Body Bearer needs secure-context Web Crypto
digest/UUID support and sessionStorage, not IndexedDB or CryptoKey. Cookie
Bearer still needs IndexedDB for non-credential metadata, plus Web Locks and
BroadcastChannel (also required for cookie DPoP). Keyless does not mean storage-free.
Feature checks run when creating/using a session, so importing the module is
safe before browser startup. Keep one lazy session per tab/vault mount.
Node tooling/runtime imports require Node >=22.12.0: the CJS entry
synchronously requires ESM-only jose, using Node's default require(esm)
support. Node 22.0–22.11 cannot load it without an experimental flag. Node
importability does not supply the browser storage needed to create a session.
Strict DOM-only TypeScript consumers can use types: [] and
skipLibCheck: false with Bundler or NodeNext resolution. ESM resolves
index.d.mts, CJS resolves index.d.ts; both are self-contained, without Node
types, Express augmentation, or a backend package dependency. In workspace/npm
source-tree packs these files live under dist/; release packaging flattens
them and rewrites the export map. Always import by package name.
Named root imports only; no default export, no deep dist/* or src/* imports.
import {
createDeviceFingerprint,
createDpopProof,
createOidcVaultDpopSession,
fetchWithDpop,
fingerprintJsSignalSource,
getOrCreateDpopKey,
OidcVaultDpopClientError,
} from '@web-ts-toolkit/oidc-vault-dpop-client';
import type {
DpopAccessToken,
DpopApi,
DpopFetchContext,
DpopFetchOptions,
DpopKey,
OidcVaultDpopSession,
BearerAccessToken,
BearerApi,
BearerFetchContext,
OidcVaultAccessToken,
OidcVaultBearerSession,
OidcVaultBearerSessionOptions,
OidcVaultSession,
OidcVaultSessionOptions,
OidcVaultFetchContext,
} from '@web-ts-toolkit/oidc-vault-dpop-client';
export const sessionApi = { createOidcVaultDpopSession, fetchWithDpop };
export type { DpopAccessToken, DpopKey, OidcVaultDpopSession, BearerAccessToken, OidcVaultSession };
DpopNonceCache and the DeviceFingerprint family are also exported from the
root for typed consumption. Non-public coordination helpers
(withDpopDatabase, resolveDpopScope, cookie-version bookkeeping) stay
internal on purpose: scope to one backendOrigin + basePath per session and
let the session own key/proof/nonce coordination.
One vault mount, one session. basePath must equal the backend's exact public
mount (the core default is /auth/oidc; the example app mounts
/auth/oidc/body and /auth/oidc/cookie side by side — pick the one you call).
import {
createOidcVaultDpopSession,
fetchWithDpop,
OidcVaultDpopClientError,
} from '@web-ts-toolkit/oidc-vault-dpop-client';
const backendOrigin = 'https://api.example.com';
const session = createOidcVaultDpopSession({
backendOrigin,
basePath: '/auth/oidc/body',
sessionTransport: 'body',
});
// A login button calls this; login creates/persists the key BEFORE POST and navigation.
export async function signIn(): Promise<void> {
await session.login('/callback?transport=body');
}
// On /callback or application bootstrap:
export async function bootstrap(): Promise<'ready' | 'sign-in'> {
try {
const url = new URL(location.href);
const code = url.searchParams.get('code');
if (code !== null) {
url.searchParams.delete('code');
history.replaceState(null, '', url.href);
await session.exchange(code);
} else {
await session.refresh(); // Existing persistent key only; no Authorization/ath.
}
return 'ready';
} catch (error) {
if (error instanceof OidcVaultDpopClientError && error.requiresLogin) return 'sign-in';
throw error; // Keep recovery state on transient/proof/nonce failures.
}
}
export async function getProfile(): Promise<unknown> {
const response = await fetchWithDpop(
{ session, apis: [{ origin: backendOrigin, replayNamespace: 'my-app-api' }] },
`${backendOrigin}/api/profile`,
);
if (!response.ok) throw new Error('Protected API request failed.');
return response.json();
}
export async function signOut(): Promise<void> {
await session.logout();
}
Lifecycle is login → exchange(code) → getAccessToken()/fetchWithDpop → refresh → logout. Vault POSTs carry no Authorization and no ath, so local
JWT expiry never blocks refresh. All vault and API credential responses are
Cache-Control: no-store; body handles are tab-local (see
Storage).
On a new tab with no usable login, bootstrap returns 'sign-in'; show the
sign-in action. On success it has accepted the response contract, including
valid zero-lifetime credentials (bound profile).
Render a recoverable error for other failures rather than clearing auth or
automatically repeating mutations. A corrupt persisted key needs the explicit
reset-then-login action.
Same session shape, sessionTransport: 'cookie', and the matching cookie
mount. Cookie mode additionally requires Web Locks and
BroadcastChannel at runtime; unsupported browsers fail explicitly via
DPOP_TAB_COORDINATION_UNSUPPORTED.
import { createOidcVaultDpopSession } from '@web-ts-toolkit/oidc-vault-dpop-client';
export const session = createOidcVaultDpopSession({
backendOrigin: 'https://api.example.com',
basePath: '/auth/oidc/cookie',
sessionTransport: 'cookie',
});
export async function signIn(): Promise<void> {
await session.login('/callback?transport=cookie');
}
Apply the callback/bootstrap, API and logout flow above to this session.
Cookie refresh uses one same-origin Web Lock per vault scope plus
BroadcastChannel winner-token delivery: a tab adopts a live peer token for up
to 180ms, otherwise it performs its own serialized refresh with the current
browser cookie. Peer adoption still validates payload, key binding, expiry,
generation, and current recognition. Each API call and retry signs its own
fresh proof. Web Locks coordinate tabs of one frontend origin, storage
partition, and vault scope — they are not a backend refresh lease, so other
frontends, devices, or processes can still race upstream refresh families.
Use only with a supported backend/API pairing. The names
stay createOidcVaultDpopSession and fetchWithDpop; there is no rename or alias.
The immutable selection is snapshotted at construction; nonboolean runtime
values reject. Changing options later, a response or an authentication challenge
cannot change mode. Switching requires a fresh login, not refreshing an
existing bound session as Bearer. Close/reload old DPoP-only tabs first when
replacing a shared cookie session (see Storage).
import {
createOidcVaultDpopSession,
fetchWithDpop,
OidcVaultDpopClientError,
type BearerAccessToken,
type OidcVaultBearerSessionOptions,
} from '@web-ts-toolkit/oidc-vault-dpop-client';
const backendOrigin = 'https://api.example.com';
let view: BearerAccessToken | undefined; // Optional memory-only mirror.
const options: OidcVaultBearerSessionOptions = {
backendOrigin,
basePath: '/auth/oidc/body',
sessionTransport: 'body', // Or 'cookie' with the matching cookie mount.
dpop: false,
autoRefresh: { refreshBeforeExpiryMs: 60_000 }, // Optional; default is off.
onCredentialsChanged(credentials) {
view = credentials; // Inferred BearerAccessToken | undefined; no jkt.
},
onAutoRefreshError(error) {
// Report paused scheduling; never automatically retry an uncertain rotation.
console.error(error instanceof OidcVaultDpopClientError ? error.code : 'refresh-paused');
},
};
const session = createOidcVaultDpopSession(options);
export const readView = () => view;
export const signIn = (): Promise<void> => session.login('/callback');
// Explicit callback/reload bootstrap, not performed by construction or autoRefresh.
export async function bootstrap(): Promise<'ready' | 'sign-in'> {
try {
const url = new URL(location.href);
const code = url.searchParams.get('code');
if (code !== null) {
url.searchParams.delete('code');
history.replaceState(null, '', url.href);
await session.exchange(code);
} else await session.refresh();
return 'ready';
} catch (error) {
if (error instanceof OidcVaultDpopClientError && error.requiresLogin) return 'sign-in';
throw error;
}
}
export const refresh = (): Promise<BearerAccessToken> => session.refresh();
export const loadProfile = (): Promise<Response> =>
fetchWithDpop({ session, apis: [{ origin: backendOrigin, pathPrefix: '/api' }] }, `${backendOrigin}/api/profile`); // Authorization: Bearer <app-local token>; no proof/nonce/key work.
export const signOut = (): Promise<void> => session.logout();
An inline literal dpop: false infers the same Bearer observer/session types;
existing OidcVaultDpopSessionOptions stays DPoP-only. For a runtime boolean,
use the union options and narrow credentials by tokenType, sessions by dpop:
import {
createOidcVaultDpopSession,
fetchWithDpop,
type OidcVaultAccessToken,
type OidcVaultSessionOptions,
type OidcVaultFetchContext,
} from '@web-ts-toolkit/oidc-vault-dpop-client';
export function configureSession(dpopEnabled: boolean) {
let view: OidcVaultAccessToken | undefined;
const options: OidcVaultSessionOptions = {
backendOrigin: 'https://api.example.com',
dpop: dpopEnabled,
autoRefresh: { refreshBeforeExpiryMs: 60_000 },
onCredentialsChanged(credentials) {
view = credentials;
if (credentials?.tokenType === 'DPoP') credentials.jkt satisfies string;
// Bearer has no jkt; never invent one or persist the token.
},
onAutoRefreshError: () => {
/* Show explicit recovery UI. */
},
};
const session = createOidcVaultDpopSession(options);
// Runtime-mode contexts still need DPoP-compatible namespaces.
const context: OidcVaultFetchContext = {
session,
apis: [{ origin: options.backendOrigin, replayNamespace: 'app-api' }],
};
return {
session,
readView: () => view,
loadProfile: () => fetchWithDpop(context, `${options.backendOrigin}/api/profile`),
};
}
Only definitely-Bearer BearerApi/BearerFetchContext may omit
replayNamespace; a supplied namespace is validated but unused. Runtime-mode
contexts require namespaces until narrowed to !session.dpop.
Bearer's interface has no getKey, resetKey or logoutAndNavigate.
Runtime probes reject fixed nonterminal DPOP_OPERATION_UNSUPPORTED before
storage/key/network/navigation or lifecycle side effects. Ordinary logout()
works even after app-token expiry. There is no unbound provider-navigation logout.
Bearer uses the same FIFO, observers and default-off scheduler, HTTP bounds, scope/header restrictions, CSRF/transaction-cookie protection and credentials matrix. It never sends a DPoP proof, reads nonce headers or uses a nonce cache. An API must independently authenticate/authorize unbound credentials; choosing Bearer at the vault does not turn off an API's required-binding policy.
DPoP only. With server logoutNavigation enabled, call logoutAndNavigate(): Promise<void>
from a user action. It confirms local logout, clears old frontend auth and invokes
the synchronous navigate(url) adapter (default location.assign) inside lifecycle
authority. logout() remains local-only. No return-URL/prepare API is needed.
import {
createOidcVaultDpopSession,
type OidcVaultLogoutNavigationInput,
type OidcVaultLogoutNavigationResult,
} from '@web-ts-toolkit/oidc-vault-dpop-client';
const session = createOidcVaultDpopSession({
backendOrigin: 'https://api.example.com',
basePath: '/auth/oidc',
sessionTransport: 'body', // Or the matching cookie mount and 'cookie'.
});
export const signOutThroughProvider = (): Promise<void> => session.logoutAndNavigate();
// Pure wire types are also bundled at the client root; no backend install needed.
export type NavigationRequest = OidcVaultLogoutNavigationInput;
export type NavigationResponse = OidcVaultLogoutNavigationResult;
The existing persistent key plus body handle or active matching cookie metadata
suffices after reload, with an absent or expired memory JWT. It does not refresh,
create a replacement key, send fingerprint/Authorization/ath, or put API tokens
in query strings. POST uses the same finite HTTP bounds and nonce cache, including
learned success nonces: at most one recognized challenge retry with a fresh proof/JTI.
Body credentials are omit with { sessionId }; cookie credentials are include
with {} under the scope Web Lock. Strict server Origin/Referer checks apply in
both transports; allow the frontend via trustedOrigins and expose DPoP-Nonce in CORS.
The client accepts only the exact absolute pinned backend continuation path,
bare or followed by one literal ?ticket=lnt_<43 canonical base64url characters>.
No upstream URL/hint enters initiation JSON. A confirmed loggedOut: true clears
token, handle, pending login, nonces and peer adoption, and invalidates cookie
metadata/notifies peers even if the URL is invalid; that case rejects with fixed
nonterminal INVALID_LOGOUT_NAVIGATION_RESPONSE and never navigates. Unconfirmed,
malformed, oversized, timed-out or lost responses leave the server commit uncertain,
retain the existing failure policy and never automatically retry or navigate.
Cleanup/adapter failure rejects after memory clear, without credential restoration.
Concurrent clicks share the same pending Promise through FIFO, nonce retry, cleanup and one adapter invocation. An earlier refresh publishes rotation first; a later refresh cannot resurrect credentials. Refresh does not split that click batch. Later login/exchange/local logout/clear/resetKey/dispose immediately withdraws navigation intent, including a login still queued for the FIFO/lock. A started POST may finish old-state cleanup before that login, but rejects as superseded instead of navigating. No completed ticket URL is cached; another click after cleanup requires login. Cancellation cannot undo server commit or navigation already handed to the browser.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.