
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@civic/auth-verify
Advanced tools
JWT verification library for Civic Auth tokens using JWKS endpoint discovery.
pnpm add @civic/auth-verify
import { verify } from '@civic/auth-verify';
// Verify a token with default settings (uses Civic Auth issuer)
const payload = await verify(token);
console.log(payload);
By default, the library uses an in-memory cache for JWKS data. You can provide your own cache implementation if needed.
In the in-memory cache, keys are stored in memory and lost when the process restarts.
The library uses a shared default instance across all verify
calls unless you provide your own.
If you want to control the lifecycle of the cache, provide your own as follows:
import { verify, InMemoryJWKSCache } from '@civic/auth-verify';
// Create a custom cache instance
const cache = new InMemoryJWKSCache();
// Use the cache for verification
const payload = await verify(token, {
jwksCache: cache
});
The Bundled Cache is a key cache pre-populated with Civic Auth JWKS keys, useful for offline verification or reduced latency.
Note: The bundled JWKS is specific to Civic Auth keys. If using another issuer, you can still use the InMemoryJWKSCache
or implement your own cache.
import { verify, BundledJWKSCache } from '@civic/auth-verify';
// Use bundled cache with pre-downloaded Civic Auth JWKS
const cache = new BundledJWKSCache();
const payload = await verify(token, {
jwksCache: cache
});
verify(token: string, options?: VerifyOptions): Promise<JWTPayload>
Verifies a JWT token and returns its payload.
token
- The JWT token to verifyoptions
- Optional verification options
issuer
- The token issuer URL (defaults to Civic Auth)wellKnownConfigurationUrl
- Custom OpenID configuration URLjwksCache
- Custom JWKS cache implementationaud
- Expected audience value for the token (optional)clientId
- Expected client ID value for the token (optional). If provided, the JWT must contain this value in either the client_id
or tid
fieldA promise that resolves to the JWT payload.
# Install dependencies
pnpm install
# Run tests
pnpm test
# Build
pnpm build
# Lint
pnpm lint
FAQs
JWT verification library for Civic Auth
We found that @civic/auth-verify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.