npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sentropic/oauth-verify

v0.1.0

Published

Framework-free OAuth2/OIDC access-token and DPoP-proof verification core for Sentropic: verify-only primitives, pluggable key source (remote JWKS or in-process), and canonical claim types. No issuer/signing/PRM logic; no MCP scope grammar.

Readme

@sentropic/oauth-verify

Framework-free OAuth2/OIDC verification core for Sentropic. It provides the verify-only primitives that both the authorization server (@sentropic/auth-hono) and resource servers (@sentropic/mcp-auth, app endpoints) share, so security-critical verification logic lives in exactly one place.

  • Access-token verificationjwtVerify against a resolved key, validating issuer, audience, expiry and required scopes.
  • DPoP-proof verification (RFC 9449) — header jwk + signature, htm/htu/iat/ath checks, optional single-use jti replay guard, returns the key thumbprint (jkt) + jti.
  • Pluggable key source — a TokenKeySource port with two adapters: a remote JWKS (fromRemoteJwks, for external resource servers) and an in-process JWKS provider (fromJwksPort, for the IdP-colocated server).
  • Canonical claim typesAccessTokenClaims, ActClaim, IdentityType.

Out of scope by design (architect verdict, spec/SPEC_STUDY_39_MCP_LIBRARIZATION.md §2/§10): no issuer/signing logic, no PRM serving, no MCP scope grammar — those live in @sentropic/auth-hono (issuance) and @sentropic/mcp-auth (resource-server profile).

Scope

  • Framework-free: zero Hono, zero zod, zero storage. Runs anywhere fetch + WebCrypto run (Node, workers, edge).
  • jose is the only peer dependency.

Install

npm install @sentropic/oauth-verify

jose is a peer dependency.

Quickstart

Verify an access token (in-process key source)

import { fromJwksPort, verifyAccessToken } from '@sentropic/oauth-verify';

// jwksProvider exposes findKeyByKid(kid) and getActiveKey() (e.g. auth-hono's JwksPort).
const keySource = fromJwksPort(jwksProvider);

const claims = await verifyAccessToken({
  token,
  keySource,
  issuer: 'https://api.example.com',
  audience: 'https://api.example.com',
  requiredScopes: ['service:ping'],
});

Verify an access token (remote JWKS — external resource server)

import { fromRemoteJwks, verifyAccessToken } from '@sentropic/oauth-verify';

const keySource = fromRemoteJwks('https://api.example.com/.well-known/jwks.json', {
  cacheMaxAgeSec: 600,
});

const claims = await verifyAccessToken({
  token,
  keySource,
  issuer: 'https://api.example.com',
  audience: 'https://mcp.example.com',
});

Verify a DPoP proof

import { verifyDpopProof } from '@sentropic/oauth-verify';

const { jkt, jti } = await verifyDpopProof({
  proof, // DPoP header value
  htm: request.method,
  htu: request.url,
  accessToken, // binds ath
  expectedJkt: claims.cnf?.jkt, // binds to the token's confirmation thumbprint
  replay: async (jti, expiresAt) => store.recordDpopJti(jti, expiresAt), // single-use guard
});

API

| Export | Purpose | | --- | --- | | verifyAccessToken(opts) | Verify a signed access token → AccessTokenClaims, or throw TokenVerifyError. | | verifyDpopProof(opts) | Verify a DPoP proof → { jkt, jti }, or throw DpopVerifyError. | | fromRemoteJwks(jwksUri, opts?) | TokenKeySource backed by a cached remote JWKS. | | fromJwksPort(jwksProvider) | TokenKeySource backed by an in-process JWKS provider. | | parseScopes(scope) | Split an OAuth scope string into tokens. | | AccessTokenClaims, ActClaim, IdentityType | Canonical claim types. | | TokenVerifyError, DpopVerifyError | Verification error classes. |

License

MIT