AI-native identity
Build it. Secure it.
Your coding agent can do all of it: create the app, wire sign-in, mint roles, grant access — Authfu is built to be driven by the tools you vibe-code with. Underneath: Google, Microsoft, and GitHub sign-in in every app, magic links and passkeys, two-factor checked before anything is sent, standards-based OpenID Connect.
npm install -g @authfu/cli
- $ authfu apps create my-app --link
- $ authfu roles add Editor && authfu roles assign you@app.dev admin
- ✓ sign-in wired · /admin protected by the admin role · you hold it
Every command runs on your person-scoped key, and every action is audited: person → key → action.
Quickstarts
Choose your stack.
Each guide starts at app registration and ends at a working callback—without hiding the security-sensitive parts.
60-second setup
Auth.js v5, end to end.
Install the SDK, configure the provider, and expose the Auth.js route handler. Credentials are read from your environment.
Read the annotated guide →// auth.ts — no Authfu package required
import NextAuth from "next-auth"
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [
{
id: "authfu",
name: "Authfu",
type: "oidc",
issuer: process.env.AUTHFU_ISSUER,
clientId: process.env.AUTHFU_CLIENT_ID,
clientSecret: process.env.AUTHFU_CLIENT_SECRET,
authorization: { params: { scope: "openid profile email" } },
checks: ["pkce", "state"],
},
],
})
// app/api/auth/[...nextauth]/route.ts
export const { GET, POST } = handlersBuilding with an AI coding agent?
Point it at the canonical integration guide. Exact endpoints, claims, and security constraints included.