Skip to content

About

AuthKit — AdonisJS OIDC Authorization Server kit + OIDC client + React helpers (@dudousxd/adonis-authkit-*)

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

AuthKit for AdonisJS

npm version npm downloads CI license

AuthKit is a set of packages that turn an AdonisJS app into a full OpenID Connect / OAuth2 Authorization Server (Identity Provider), let other apps consume it as OIDC clients, and give React frontends typed auth ergonomics.

It is built as an idiomatic wrapper around oidc-provider.

Features

  • OIDC / OAuth2 Authorization Server — authorization code + PKCE, refresh tokens, token exchange, discovery, JWKS, revocation, introspection.
  • MFA — TOTP, WebAuthn passkeys, recovery codes, and trusted-device skip.
  • Passwordless — magic-link email login and passkey-first login.
  • Protocol extensions — Device Flow (RFC 8628), DPoP (RFC 9449, with client-side proof generation), PAR (RFC 9126), step-up auth via acr_values, Dynamic Client Registration (RFC 7591/7592).
  • Personal agents — AI assistants acting for your users: agent identity by signed JWT (JWKS, no shared secrets) and user-approved, revocable delegation with scopes you define, over a pluggable protocol adapter (PACT built in), plus protocol extensions from their own packages: @adonis-agora/authkit-poppy serves the Personal Agent Protocol ("Poppy") 1.0 — discovery, signed Poppy-Session agent sessions, Direct/Device/Mediated sign-in, MCP, browser sessions and task coverage.
  • Native apps — RFC 8252 native clients (private-use scheme / claimed https / loopback redirects, public + PKCE, rotated refresh tokens) and oidcBearerGuard, an @adonisjs/auth guard for APIs called with a bearer access token (in-process, or as a remote resource server via JWKS / introspection).
  • Consoles — admin console (user & client CRUD, sessions, audit) and a self-service account console (apps/consent, security, profile).
  • Tokens & sessions — Personal Access Tokens, admin impersonation, back-channel logout, RP-initiated logout.
  • Hardening — progressive account lockout, per-IP rate-limiting, audit logging with an events/webhook fan-out, new-login email alerts.
  • Operability — i18n (English + pt-BR built in), OpenTelemetry metrics, authkit:doctor and authkit:rotate-keys commands, and a @adonis-agora/authkit-testing helper package.
  • Client & React — typed OIDC client resolvers (JWT/opaque/PAT) and a React useAuth() hook with role-gating components.
  • Backend SDK — @adonis-agora/authkit-sdk: one typed interface with remote (HTTP Admin API) and embedded (in-process) drivers for managing users, clients, sessions, audit, and token verification.

Packages

Package Description
@adonis-agora/authkit-core npm Shared contracts and types (Identity, SessionResolver, server config types, metric names). No runtime — consumed by the server and client packages.
@adonis-agora/authkit-server npm AdonisJS OIDC/OAuth2 Authorization Server (Identity Provider): ejectable auth server with sessions, rate-limiting, MFA/TOTP, audit log, federated logout, and OpenTelemetry metrics.
@adonis-agora/authkit-client npm OIDC relying-party (client) adapter: session-based authentication against an OpenID Connect identity provider, with JWT/PAT user resolvers and OpenTelemetry metrics.
@adonis-agora/authkit-react npm Frontend ergonomics for AdonisJS + Inertia + React apps: a typed useAuth() hook, role-gating hooks, and gating components.
@adonis-agora/authkit-sdk npm Backend SDK over the Admin API with one typed interface and two drivers: remote (HTTP/Bearer) and embedded (in-process).

Install

Run the Authorization Server in your IdP app:

node ace add @adonis-agora/authkit-server

Consume it from a client app:

node ace add @adonis-agora/authkit-client

Add the React ergonomics to an Inertia + React frontend:

pnpm add @adonis-agora/authkit-react

@adonis-agora/authkit-core is pulled in transitively by the server and client packages — you rarely install it directly.

Documentation

Full documentation lives at the docs site (coming soon). Each package also ships its own README with setup and usage details:

Development

This is a pnpm monorepo. Common tasks:

pnpm install
pnpm build       # build all packages
pnpm typecheck   # typecheck all packages
pnpm test        # run all package test suites
pnpm format      # prettier --write

Releases are managed with Changesets:

pnpm changeset           # record a version bump
pnpm release             # build + changeset publish

Sponsors

Every Agora library is MIT and stays free. The work is funded by partners and sponsors — become one.

License

MIT © Davi de Carvalho

About

AuthKit — AdonisJS OIDC Authorization Server kit + OIDC client + React helpers (@dudousxd/adonis-authkit-*)

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages