mcpField
A
auth0

auth0

github.com/auth0安全555.5k 次安装1 天前更新
代码仓库

关于 auth0

Auth0 skill 根据开发者的身份验证需求和项目框架,选择相关参考资料,涵盖集成、功能配置、安全审查与故障排查。它也支持 Auth0 CLI 和 SDK 迁移等任务。

主要功能

  1. 01识别身份验证意图与框架
  2. 02按需加载功能参考资料
  3. 03覆盖 MFA、通行密钥与组织
  4. 04指导安全审查和健康检查
  5. 05支持故障排查、迁移与 CLI

适用场景

  1. 01为应用添加 Auth0 登录
  2. 02配置 MFA 或通行密钥
  3. 03审查租户安全与运行状况
  4. 04排查认证错误或迁移身份提供方

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/auth0/agent-skills --skill auth0

安装后在 Claude Code 中输入/auth0确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

agents/
openai.yaml
assets/acul/js-templates/
login-id.js
login-password.js
assets/acul/react-templates/
login-id.tsx
login-password.tsx
assets/acul/theme-templates/
globals.css
tailwind.config.ts
theme-provider.ts
tokens.css
assets/audit/
report-template.html
report-template.md
assets/healthcheck/
report-template.html
report-template.md
references/feature-acul/
index.md
references/feature-audit-pricing/
index.md
references/feature-audit-remediation/
index.md
references/feature-audit/
index.md
references/feature-branding/
index.md
references/feature-custom-domains/
index.md
references/feature-custom-token-exchange/
auth0-android.md
auth0-api-python.md
auth0-auth-js.md
auth0-react.md
auth0-server-js.md
auth0-server-python.md
auth0-spa-js.md
auth0-swift.md
index.md
nextjs-auth0.md
react-native-auth0.md

详细介绍

Auth0

检测意图 → 检测框架 → 检测工具 → 加载 2–3 个参考文件。


步骤 1:检测意图

将请求与 开发者想要的内容 列进行匹配——该列用通俗语言描述目标,而不只是 Auth0 术语。你选择的 意图 是一个查找键:在 步骤 4 中,它会原样出现在一个章节标题中(### feature:mfa),该标题会列出要加载的参考文件。

开发者的需求(通俗表述 + Auth0 术语)意图
在应用中添加登录、注册、登录功能、“让用户登录 / 创建账户”,或以其他方式在应用或脚本中添加并使用 Auth0 SDKintegrate
在密码之后增加第二步验证 — 一次性代码、短信或电子邮件验证码、身份验证器应用,或作为额外因素使用的通行密钥 / 指纹 / 面容 / 安全密钥;或者在执行敏感操作前重新确认身份。Auth0:多因素身份验证(MFA)、双因素身份验证(2FA)、两步验证、逐步身份验证。feature:mfa
让用户使用通行密钥、指纹或 Face ID 注册或登录,而不是使用密码 — 将无密码 WebAuthn 作为主要凭据 — 或让已登录用户向其账户添加通行密钥。Auth0:通行密钥、WebAuthn、无密码登录。feature:passkeys
让不同的公司、团队、工作区或租户各自拥有自己的用户、成员、角色和登录方式 — 通常是面向企业销售的产品。Auth0:Organizations、多组织、B2B SaaS。feature:organizations
部署托管的自助服务门户,用于管理个人资料、通行密钥、MFA 或组织详情,而不是自行构建“My Account”或“My Organization”界面。Auth0:Universal Portals、My Account portal、My Organization portal。feature:universal-portals
使用自己的网址提供登录页面(例如 login.example.com、auth.company.com),而不是使用默认的 Auth0 网址。Auth0:自定义域名。feature:custom-domains
使用自己的代码或框架构建完全自定义的登录 / 注册页面,超出主题设置允许的范围。Auth0:Universal Login 高级自定义(ACUL)。feature:acul
更改登录页面的外观 — 徽标、颜色、字体、背景和整体主题。Auth0:品牌、Universal Login 自定义。feature:branding
将令牌绑定到客户端,以防被盗或泄露的令牌从另一台机器上重复使用 / 重放。Auth0:DPoP(持有证明)、发送方约束令牌。feature:dpop
将外部或合作伙伴令牌(旧系统、MCP/Agent 或其他 IdP)交换为 Auth0 令牌,无需交互式登录。Auth0:自定义令牌交换(CTE)、RFC 8693、subject_token。feature:custom-token-exchange
审计租户的安全 / 配置问题,生成报告,然后可选择修复发现的问题。Auth0:租户审计、CheckMate。audit
检查租户是否健康、所用套餐是否合适 — 提供两个评分和一条建议。Auth0:健康检查。healthcheck
咨询最佳实践、“这样安全吗?”、如何安全处理令牌、“我该如何做 X”。Auth0:指导 / 安全。guidance
遇到错误:401 Unauthorized、403 Forbidden、CORS、回调 URL 不匹配、重定向循环。Auth0:调试。debug
遇到速率限制:429 Too Many Requests、超出配额。Auth0:速率限制。debug:rate-limit
将现有应用从 Clerk、NextAuth.js、Firebase、Cognito、Okta、Supabase、Passport.js 或其他身份验证提供商迁移出来。Auth0:提供商迁移。migrate
将 Auth0 SDK 本身升级到新的主版本(例如,Auth0.swift v2→v3、Auth0.Android v3→v4)— 破坏性变更、已弃用的 API、“更新到最新 SDK”。Auth0:SDK 主版本升级。upgrade-sdk
安装 Auth0 的 Vercel Marketplace 集成,将 Auth0 连接到 Vercel 项目,或将 Auth0 配置同步到托管在 Vercel 上的 Next.js 应用。Auth0:Vercel 原生集成。integrate
直接使用 Auth0 CLI —“使用 auth0 CLI 创建应用 / API”,编写租户设置脚本,或在 CI 中自动化 Auth0 配置 — 不涉及应用框架。Auth0:CLI / 仅工具。tooling
如果没有明显匹配项

选择最接近的目标。如果目标确实不明确,请询问开发者想要实现什么 — 不要猜测意图。


步骤 2:检测框架

对于 tooling 意图,跳过此步骤——以 CLI 为先的请求不涉及框架。 转到步骤 3,加载 tooling 参考;只有当开发者之后转而询问如何将 身份验证集成到应用中时,才询问框架。

从上到下检查。找到第一个能确定框架的层级后即停止。

层级 1 — 已安装 Auth0 SDK(最强信号)
Node.js / JavaScript / TypeScript — 检查 package.json → dependencies

表格行按具体程度从高到低排列:Ionic/Capacitor 项目也会包含基础 SDK, 因此请先检查 @capacitor/browser 对应的行。

软件包框架
@capacitor/browser + @auth0/auth0-angularionic-angular
@capacitor/browser + @auth0/auth0-reactionic-react
@capacitor/browser + @auth0/auth0-vueionic-vue
@auth0/nextjs-auth0nextjs
@auth0/auth0-nuxtnuxt
@auth0/auth0-tanstack-start-reacttanstack-start
@auth0/auth0-reactreact
@auth0/auth0-vuevue
@auth0/auth0-angularangular
@auth0/auth0-spa-jsspa-js
express-openid-connectexpress
@auth0/auth0-fastifyfastify
@auth0/auth0-fastify-apifastify-api
express-oauth2-jwt-bearerexpress-jwt
react-native-auth0 + 存在 app.json 或 app.config.jsexpo
react-native-auth0(无 Expo 文件)react-native
@auth0/auth0-api-jsauth0-api-js
@auth0/auth0-server-jsauth0-server-js
@auth0/auth0-auth-jsauth0-auth-js
auth0(不带作用域的包,不是 @auth0/*)node-auth0
Python — 检查 requirements.txt 或 pyproject.toml

表格行按具体程度从高到低排列:auth0-server-python 是与框架无关的 服务端核心,因此请先检查是否同时安装了 Web 框架,再回退到单独的 SDK 行。

软件包框架
auth0-server-python + flaskflask
auth0-server-python(无 Flask Web 框架)server-python
auth0-fastapi-apifastapi-api
auth0-api-pythonapi-python
Java / Kotlin — 检查 build.gradle 或 pom.xml
依赖项框架
mvc-auth-commons(com.auth0:mvc-auth-commons)java-mvc
spring-security-oauth2-resource-serverspringboot-api
.NET — 检查 *.csproj 或 NuGet.Config
软件包框架
Auth0.AspNetCore.Authentication(不带 .Api 后缀)aspnetcore-auth
Auth0.AspNetCore.Authentication.Apiaspnetcore-api
Auth0.OidcClient.MAUImaui
Auth0.OidcClient.AndroidXnet-android
Auth0.OidcClient.iOSnet-ios
Auth0.OidcClient.WinFormswinforms
Auth0.OidcClient.WPFwpf
PHP — 检查 composer.json

auth0/auth0-php 通过 SdkConfiguration 的 strategy 同时支持 PHP Web 应用和 API。STRATEGY_API 行更具体——请先检查。

软件包框架
auth0/auth0-php + SdkConfiguration::STRATEGY_API(或 strategy: 'api')php-api
auth0/auth0-php(无 STRATEGY_API / STRATEGY_REGULAR,或 strategy: 'webapp')php
auth0/login(laravel,无 AuthorizationGuard)laravel
auth0/login + AuthorizationGuardlaravel-api

如果已安装 auth0/auth0-php,但尚未设置 SdkConfiguration 策略 (新建项目),请继续检查下方的变体区分部分。

Go — 检查 go.mod
模块框架
github.com/auth0/go-jwt-middlewarego
移动端(原生)
信号框架
build.gradle(.kts) + com.auth0.kmp:auth0(Kotlin Multiplatform 模块)kmp
Package.swift 或 .xcodeproj + Auth0.swiftswift
build.gradle + com.auth0.android:auth0android
pubspec.yaml + auth0_flutter + 开发者名称/目标平台为 Windows 桌面端flutter-windows
pubspec.yaml + auth0_flutter + flutter.web: falseflutter-native
pubspec.yaml + auth0_flutter + 启用 Webflutter-web
第 2 层 — 根据非 Auth0 工作区依赖识别框架

如果没有匹配到 Auth0 SDK,则根据普通(非 Auth0)依赖识别框架。**遇到第一个匹配项时即停止。**这会确定基础框架;Web 与 API 变体的判断请参见下方“变体消歧”。与第 1 层相同,先检查 @ionic/* 行,再检查其基础框架。

信号基础框架
package.json 中有 nextnextjs
package.json 中有 nuxtnuxt
package.json 中有 @tanstack/react-starttanstack-start
@ionic/* + @angular/coreionic-angular
@ionic/* + reactionic-react
@ionic/* + vueionic-vue
package.json 中有 @angular/coreangular
package.json 中有 vue(无 nuxt)vue
package.json 中有 expoexpo
react-native(无 expo)react-native
react(无上述元框架)react(SPA)——见注释
package.json 中有 expressexpress(见下方变体)
package.json 中有 fastifyfastify(见下方变体)
requirements.txt/pyproject.toml 中有 flaskflask
requirements.txt/pyproject.toml 中有 fastapifastapi-api(见下方变体)
pom.xml/build.gradle 中有 spring-bootspringboot-api
composer.json 中有 laravel/frameworklaravel(见下方变体)
存在 composer.json(无 Laravel)php(见下方变体)
存在 go.mod + HTTP 服务端/路由器go
org.jetbrains.kotlin.multiplatform 插件 + commonMain 源集(共享 Android+iOS 模块)kmp
Package.swift 或 .xcodeprojswift
pubspec.yaml(Flutter)+ 开发者名称/目标平台为 Windows 桌面端flutter-windows
pubspec.yaml(Flutter,已禁用 Web)flutter-native
pubspec.yaml(Flutter,已启用 Web)flutter-web
*.csproj 引用了 MAUImaui
*.csproj(WinForms)winforms
*.csproj(WPF)wpf
*.csproj ASP.NET(Web 应用或 API)aspnetcore(见下方变体)

**react 注释:**纯 React 项目使用 React SDK 构建 SPA 时映射为 react;如果应用是与框架无关的原生 JS,则映射为 spa-js。如果无法确定,请在加载前询问。

第 3 层 — 根据提示词确定框架

如果没有匹配到工作区信号,则映射请求中提到的框架或语言。命中第一个匹配项后停止。

开发者提到……框架
Next.js / nextnextjs
Nuxtnuxt
TanStack Start (React)tanstack-start
Angular(非 Ionic)angular
Vue(非 Nuxt/Ionic)vue
React SPA(非 Next.js)react
vanilla JS / plain JS / no framework SPAspa-js
node-auth0 / auth0 npm 包node-auth0
@auth0/auth0-api-js / auth0-api-js / 底层资源服务 SDKauth0-api-js
@auth0/auth0-server-js / auth0-server-js / 服务端 Auth0 会话 SDKauth0-server-js
@auth0/auth0-auth-js / auth0-auth-js / AuthClient / 底层 OAuth OIDCauth0-auth-js
Express(Web 应用 / 服务端渲染)express
Express API / 保护 API 路由express-jwt
Fastify(Web)/ Fastify APIfastify / fastify-api
Flaskflask
FastAPI(Web 应用)/ FastAPI APIserver-python / fastapi-api
auth0-server-python / 框架无关的 Python 服务端 SDK / 没有专用参考资料的 Python OIDC Web 服务(Django、Starlette、Sanic、Quart、aiohttp)server-python
auth0-api-python / Python API JWT 验证器(资源服务 / verify_access_token)api-python
Spring Bootspringboot-api
Java MVC / servletjava-mvc
ASP.NET Core Web 应用 / APIaspnetcore-auth / aspnetcore-api
MAUI / WinForms / WPFmaui / winforms / wpf
PHP Web 应用 / PHP APIphp / php-api
Laravel Web 应用 / Laravel APIlaravel / laravel-api
Go / Golang APIgo
Kotlin Multiplatform / KMP / Android+iOS 共享认证代码 / com.auth0.kmpkmp
Swift / iOSswift
Android / Kotlinandroid
Flutter(原生 / Web / Windows)flutter-native / flutter-web / flutter-windows
React Native / Exporeact-native / expo
Ionic(Angular/React/Vue)ionic-angular / ionic-react / ionic-vue
变体消歧(Web 应用与 API)

部分框架有独立的 Web 应用和 API 参考资料。如果第 1 层未确定变体,请优先根据意图选择:

基础项Web 应用变体API 变体在以下情况下选择 API……
expressexpressexpress-jwt保护 API 路由 / 验证 JWT,且没有服务端渲染的 UI
fastifyfastifyfastify-api仅用于资源服务 / JWT 验证
fastapiserver-pythonfastapi-api仅用于资源服务 / JWT 验证;带有登录/注销 UI 的 Web 应用使用 server-python
phpphpphp-api构建/保护 PHP API,且没有 Web UI
laravellaravellaravel-api仅 API(token guard),没有 Blade UI
aspnetcoreaspnetcore-authaspnetcore-apiWeb API / JWT bearer,且没有 cookie 登录 UI

如果意图仍不明确(同时有 UI 和受保护的端点,或情况不清楚),请说明你检测到的内容,并询问开发者这是 Web 应用还是 API,然后再加载。

如果没有匹配项

询问开发者使用的框架/语言。不要猜测。

冲突

如果第 2 层(工作区)和第 3 层(提示词)存在实质冲突(例如,提示词说“Next.js”,但 package.json 中没有 next),请说明冲突并询问,不要默默自行选择。若两者都存在且一致,工作区信号优先于提示词。


第 3 步:检测工具

阅读项目文件树和请求——这是一个项目上下文决策。

项目包含……加载
terraform/ 目录或任何 *.tf 文件tooling-terraform/index.md
此 Agent 会话中已启用 Auth0 MCP 服务tooling-mcp/index.md
请求使用 Auth0 Vercel Marketplace/原生集成,或将 Auth0 连接到 Vercel 项目tooling-vercel/index.md
其他任何情况(默认)tooling-cli/index.md

第 4 步:加载参考文件

找到下方标题与您在第 1 步中选择的意图相匹配的部分,然后阅读其中列出的参考文件。

integrate
Read: references/framework-{framework}/index.md
Read: references/tooling-{tooling}/index.md
Follow the integration workflow in references/framework-{framework}/index.md.
Use references/tooling-{tooling}/index.md for all Auth0 tenant configuration steps.
feature:mfa
Read: references/feature-mfa/index.md
Read: references/tooling-{tooling}/index.md
feature:passkeys
Read: references/feature-passkeys/index.md
Then Read the detected SDK's passkey leaf from the hub's "Example code snippets" table (e.g. nextjs → nextjs-auth0.md; react-native/expo → ONLY react-native-auth0.md, which covers react-native-web — never auth0-react.md) — it has the exact API and ceremony; don't implement from framework-{framework}/index.md alone.
Read: references/tooling-{tooling}/index.md
If framework detected: Read references/framework-{framework}/index.md
feature:organizations
Read: references/feature-organizations/index.md
Read: references/tooling-{tooling}/index.md
If framework detected: Read references/framework-{framework}/index.md
If multi-tenant architecture / B2B SaaS design question: also Read references/pattern-multi-tenant/index.md
feature:universal-portals
Read: references/feature-universal-portals/index.md
Read: references/tooling-{tooling}/index.md
feature:custom-domains
Read: references/feature-custom-domains/index.md
Read: references/tooling-{tooling}/index.md
feature:acul
Read: references/feature-acul/index.md
Read: references/tooling-{tooling}/index.md
feature:branding
Read: references/feature-branding/index.md
Read: references/tooling-{tooling}/index.md
feature:dpop
Read: references/feature-dpop/index.md
Read: references/tooling-{tooling}/index.md
If a SPA framework is detected (vue/react/angular/spa-js): Read references/framework-{framework}/index.md
DPoP is SPA-only (no SSR: Next.js/Nuxt) — feature-dpop/index.md states the exclusion.
feature:custom-token-exchange
Read: references/feature-custom-token-exchange/index.md
Read: references/tooling-{tooling}/index.md
If framework detected: Read references/framework-{framework}/index.md
guidance
Read: references/pattern-security/index.md
If framework detected: Read references/framework-{framework}/index.md (for SDK-specific guidance — token storage, session handling, route protection)
If token handling / JWT vs opaque / storage: Read references/pattern-token-handling/index.md
If multi-tenant / B2B architecture: Read references/pattern-multi-tenant/index.md + references/feature-organizations/index.md
debug
Read: references/pattern-common-errors/index.md
If framework detected: Read references/framework-{framework}/index.md
debug:rate-limit
Read: references/pattern-rate-limiting/index.md
migrate
Read: references/feature-migration/index.md
Read: references/tooling-{tooling}/index.md
If framework detected: Read references/framework-{framework}/index.md
audit
Read: references/feature-audit/index.md
Read: references/feature-audit-pricing/index.md
Read: references/feature-audit-remediation/index.md
Read: references/tooling-{tooling}/index.md
Apply findings only with per-command confirmation; verify each change by re-fetch.
healthcheck
Read: references/feature-healthcheck/index.md
Read: references/feature-audit/index.md
Read: references/feature-audit-pricing/index.md
Read: references/feature-audit-remediation/index.md
Read: references/tooling-{tooling}/index.md
If a scan can run, do the audit workflow first, then score and recommend a plan. If not, score capability fit and recommend anyway. Never quote Enterprise pricing.
upgrade-sdk
Read: references/framework-{framework}/index.md
Follow its "Major Version Migration" section (e.g. Auth0.swift v3, Auth0.Android v4).
This is an Auth0 SDK version bump — NOT a provider migration. Do not load feature-migration/index.md.
If no framework is detected: ask which Auth0 SDK the developer is upgrading.
tooling
Read: references/tooling-{tooling}/index.md
No framework file — this is a CLI/tooling-only task (create apps/APIs, script
tenant setup, automate config in CI). If the developer then wants to integrate
auth into an app, return to Step 1 with the integrate intent.

评论

支持 Markdown