Skip to content

@bkey/login v0.1.0

Choose a tag to compare

@fabianbaier fabianbaier released this 03 Sep 22:07
98f56c0

First release of @bkey/login — Login with bkey: drop-in, passwordless, phishing-resistant OIDC sign-in for websites and apps.

npm install @bkey/login

What's in it

  • Self-serve client registration (RFC 7591) — registerClient() gets you a client_id/client_secret with no dashboard and no account, plus the full dynamic client lifecycle: getRegisteredClient(), updateRegisteredClient(), rotateClientSecret(), deleteRegisteredClient(), claimRegisteredClient(), and uploadRegisteredClientLogo().
  • PKCE flow helpers and id_token verification — createBkeyLogin() handles the authorization request, the code exchange, and jwtVerify against the issuer's remote JWKS.
  • Auth.js provider preset — import { BkeyProvider } from '@bkey/login/authjs'.

Verification posture

id_token verification pins a static algorithms: ['EdDSA'] allowlist that is deliberately not derived from the discovery document, so a tampered doc cannot widen the accepted algorithms. exp and iat are required explicitly rather than validated only-when-present, and discovery and registration reject redirects under a shared five-second deadline.

The default issuer is https://id.bkey.id. Note that auth.bkey.id serves a discovery document declaring "issuer": "https://id.bkey.id", so pointing a client at auth.bkey.id fails with issuer_mismatch in any conformant client — use id.bkey.id.

Requirements

Node >= 20. Depends on jose 6.x.

Provenance

Published from GitHub Actions with npm provenance, so the tarball carries a signed attestation linking it to this release's workflow run and commit. Verify with npm audit signatures.

See CHANGELOG.md for the full entry.