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

@mayurajs/auth-entra

v1.2.0

Published

Microsoft Entra ID access tokens for your API as Mayura server identities, single- or multi-tenant.

Readme

@mayurajs/auth-entra

Microsoft Entra ID access tokens for your API as Mayura server identities: verified with Microsoft's published keys, on any runtime, with no dependency (no MSAL).

npm install mayura @mayurajs/auth-entra
import { mapCapabilities, principalId } from 'mayura/auth';
import { entraAuthenticator } from '@mayurajs/auth-entra';

const authenticate = entraAuthenticator({
  tenants: ['11111111-1111-4111-8111-111111111111'], // or 'any' for a multi-tenant application
  audience: ['aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa', 'api://agents'], // your API's client id and app ID URI
  identity: session => ({
    principalId: principalId('entra', session.objectId),
    projectId: session.tenantId,
    agentIds: ['support'],
    capabilities: mapCapabilities(session.roles, { 'Agents.Use': ['runs:submit', 'runs:read'] }),
  }),
});
// createAgentServer({ ..., authenticate })
  • Which tokens. RS256 access tokens issued for your API (aud) by a tenant you list, with the issuer substituted for that tenant (https://login.microsoftonline.com/<tenant>/v2.0), never matched by pattern. With tenants: 'any' each token's issuer is still its own tenant's, and identity decides which tenants get anything.
  • Microsoft's keys. v2.0 tokens are checked against https://login.microsoftonline.com/common/discovery/v2.0/keys. A key that names its issuer verifies only that issuer's tokens, so a key bound to one tenant never verifies another's. v1.0 tokens (https://sts.windows.net/<tenant>/, with versions: ['1.0', '2.0']) use the v1.0 key set. Tokens from tenants not accepted never make it fetch.
  • Refused. App-only tokens (client credentials, no scp) unless allowApps, tokens whose tid is not their issuer's tenant, and tokens with no object id. It refuses to be configured for Microsoft Graph's audience: tokens for Graph are Graph's to check.
  • What you get. identity receives the session: objectId (the stable key, the same across your applications), tenantId, subject (pairwise), app, clientId, roles, scopes, name, username (never a key), version and the raw claims. Nothing is granted unless identity grants it.
  • Options: tenants, audience, identity, allowApps, versions (['2.0']), clockSkewMs (5 s), maxIdentityMs (60 s), fetch.

See Authentication and API keys. Apache-2.0.