nocobase-app-plugin-authentication
Ce qu’il fait
Cette skill guide la gestion de l'identification des utilisateurs dans une application NocoBase 3, avec Better Auth. Elle s'adresse aux développeurs qui protègent des pages, personnalisent la connexion ou ajoutent une méthode de connexion.
Quand l’utiliser
- ✓Quand vous devez protéger une route d'API ou une page pour que seuls les utilisateurs connectés puissent y accéder.
- ✓Quand vous voulez ajouter une connexion sociale ou OIDC à votre application.
- ✓Quand vous voulez personnaliser les pages de connexion, d'inscription ou de mot de passe.
Lien du skill
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-authentication/skills/nocobase-app-plugin-authentication/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Je voudrais ajouter la connexion Google à mon application NocoBase et exiger un utilisateur connecté pour la page d'administration.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'IA ajoute la méthode de connexion dans la configuration Better Auth et protège les routes grâce à la session. Elle personnalise ensuite les pages de connexion si nécessaire.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
Authentication development
Use this Skill when an application built on @nocobase/app-plugin-authentication
needs anything about who the caller is: protecting a route or page, reading the
current user, changing the sign-in pages, adding a sign-in method, disabling
accounts, or preparing authentication for deployment.
Do not use it for what a signed-in user may do — that is
nocobase-app-plugin-authorization — or for the user administration page,
which is nocobase-app-plugin-users. Do not modify the plugin's own source,
migrations, or dist/; everything below is done in the application.
The plugin wraps Better Auth. Application configuration is Better Auth configuration, and every Better Auth plugin, social provider, and hook is available through it. Read the installed Better Auth version's documentation for option details; this Skill covers where those options go in a NocoBase application and what the plugin adds on top.
Enable an official Better Auth plugin before writing anything of your own: device login for a CLI (deviceAuthorization() with bearer()), organizations, two-factor and passkeys all exist upstream, and each needs only configuration, an application migration for its tables, and its UI. Enabling an official Better Auth plugin covers the rule, the schema check and the migration.
Public surfaces
Server, from @nocobase/app-plugin-authentication (the root entry is the
server entry) or @nocobase/app-plugin-authentication/server:
authenticationTokenresolves theAuthinstance:required(),optional(),getSession(headers),handler(request),signInUser(userId, request).AuthEnvtypes a Hono router whose routes readcontext.get('auth').userAdministrationServiceTokenresolvesUserAdministrationService:list,get,create,update,disable,enable,resetPassword,revokeSessions,withConnection; errors areUserAdministrationError.AuthConfigis Better Auth'sBetterAuthOptions, the type of the application'sserver/config/auth.ts. User initialization configuration lives separately underusers.initialAdmin.createAuthentication,databaseAdapter,createAuthStoragebuild an instance outside the application runtime, mainly in tests.
Client, from @nocobase/app-plugin-authentication/client:
authentication()is the registration factory. It takes no options, contributes no routes, and mounts one React provider.useAuthentication()returns{ client, session, isPending, refresh };useAuthenticationClient()returns the Better Auth client alone.RequiredAuthentication,GuestAuthentication, andAuthenticationGuard({ mode })gate a route subtree on the session.AuthConfigis Better Auth's client options, the type of the application'sclient/config/auth.ts.authenticationClientTokenis the client's service token, used to stub the client in component tests.
Headless actions, from @nocobase/app-plugin-authentication/client/actions:
usePasswordLogin, usePasswordRegistration, usePasswordResetRequest,
usePasswordReset, each returning { submit, isPending, error }.
HTTP: every Better Auth endpoint is served under /api/auth/* by the plugin's
own route. A Better Auth plugin's endpoints appear there automatically. There
is no other authentication REST surface.
API document: the plugin lets a signed-in session read the App's OpenAPI document at GET /api/swagger and its Swagger UI at GET /api/swagger/docs; an anonymous request gets 401 with error.reason API_DOCS_UNAUTHENTICATED, and @nocobase/app-plugin-api-keys adds API keys as a second way in. The plugin also merges Better Auth's endpoints into that document from Better Auth's own OpenAPI generator, at their full /api/auth/... paths and tagged Authentication, so a Better Auth plugin added to auth.plugins is documented without further work. Browser-only steps are left out: /sign-in/social, /link-social, /callback/{id}, /verify-email, /reset-password/{token}, /delete-user/callback and /error. Do not add Better Auth's openAPI() plugin: it would publish its own unauthenticated /api/auth/reference page and schema route.
Choose the task path
| The task is | Read | | ---------------------------------------------------
Questions fréquentes
Cela décide-t-il de ce que les utilisateurs peuvent faire ?
Non. Ce qu'un utilisateur connecté peut faire relève de la skill d'autorisation.
Puis-je ajouter la double authentification ou les passkeys ?
Oui. La skill couvre l'activation des plugins officiels de Better Auth, comme la double authentification et les passkeys.
Cela modifie-t-il le code du plugin ?
Non. Toutes les modifications vont dans votre application.
Détails
Description originale de l’auteur
Build authentication requirements in a NocoBase 3 application: protect API routes and pages with the session, read and refresh the session in the browser, customize the login, registration and password pages, add sign-in methods such as social login, OIDC or a custom Better Auth plugin, enable official Better Auth plugins (device login for a CLI, bearer tokens, organizations, two-factor, passkeys) with the migration their tables need, manage account lifecycle from server code, and configure secrets, cookies and shared storage for deployment.
repo: nocobase/nocobase
Popularité
- Étoiles GitHub
- 25k
- Position au classement
- #10089
- Licence
- —
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
nocobase-app-development
25kAide votre agent à construire les pages, les routes, les données, les permissions et les tests d'une application métier NocoBase 3 complète.
shadcn
25kAide votre agent à trouver, ajouter, corriger et styliser des composants shadcn/ui dans un projet web, en utilisant leur documentation officielle et leurs registres.
nocobase-app-plugin-development
25kAide votre agent à créer et maintenir des extensions NocoBase 3 dans une application existante, y compris les parties serveur, client, base de données et enregistrement.
nocobase-app-upgrade
25kAide votre agent à mettre à niveau une application NocoBase vers une version plus récente du modèle, en intégrant les changements du modèle tout en conservant votre propre travail.
Skills similaires
reverse-engineer-anything
422kAide votre agent à analyser les applications et paquets livrés, pour expliquer leurs fonctions, comparer des versions ou guider une reconstruction, avec REA.
1password
394kAide votre agent à configurer l'interface en ligne de commande de 1Password, à se connecter, et à lire ou injecter des secrets sans afficher leurs valeurs dans le chat.
healthcheck
394kAide votre agent à auditer l'ordinateur ou le serveur qui fait tourner OpenClaw pour détecter des risques de sécurité, comme SSH, le pare-feu, les mises à jour et les sauvegardes, puis à proposer des corrections sûres.