auth0-migration by auth0/agent-skills
npx skills add https://github.com/auth0/agent-skills --skill auth0-migration将用户和身份验证流程从现有身份验证提供商迁移到 Auth0。
auth0-quickstart检查项目是否已有身份验证:
在代码库中搜索常见的身份验证相关模式:
| 模式 | 指示 |
|---|---|
| , |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
signInWithEmailAndPasswordonAuthStateChanged| Firebase Auth |
useUser, useSession, isSignedIn | 现有身份验证钩子 |
passport.authenticate, LocalStrategy | Passport.js |
authorize, getAccessToken, oauth | OAuth/OIDC |
JWT, jwt.verify, jsonwebtoken | 基于令牌的身份验证 |
/api/auth/, /login, /callback | 身份验证路由 |
如果检测到现有身份验证,询问:
我检测到您的项目中已有身份验证。您是:
- 迁移到 Auth0(替换现有身份验证)
- 同时添加 Auth0(暂时保留两者)
- 全新开始(移除旧身份验证,新建 Auth0 设置)
从您当前的提供商导出用户。有关详细说明,请参阅 用户导入指南:
每个用户所需的数据:
通过仪表板、CLI 或管理 API 导入用户。
快速开始:
# 通过 Auth0 CLI
auth0 api post "jobs/users-imports" \
--data "connection_id=con_ABC123" \
--data "users=@users.json"
详细说明:
更新您的应用程序代码以使用 Auth0 SDK。
有关详细的前后示例,请参阅代码迁移模式:
前端:
后端:
特定提供商:
迁移代码后,使用特定框架的技能:
auth0-react 用于 React 应用程序auth0-nextjs 用于 Next.js 应用程序auth0-vue 用于 Vue.js 应用程序auth0-angular 用于 Angular 应用程序auth0-express 用于 Express.js 应用程序auth0-react-native 用于 React Native/Expo 应用程序如果您的 API 验证 JWT,请更新以验证 Auth0 令牌。
主要区别:
https://YOUR_TENANT.auth0.com/https://YOUR_TENANT.auth0.com/.well-known/jwks.json有关以下内容,请参阅JWT 验证示例:
对于拥有活跃用户的生产应用程序,请使用分阶段方法:
同时支持 Auth0 和旧提供商:
// 在迁移期间支持两个提供商
const getUser = async () => {
// 首先尝试 Auth0
const auth0User = await getAuth0User();
if (auth0User) return auth0User;
// 回退到旧提供商
return await getLegacyUser();
};
| 问题 | 解决方案 |
|---|---|
| 密码哈希不兼容 | 使用 Auth0 自定义数据库连接进行惰性迁移 |
| 社交登录无法关联 | 配置相同的社交连接,用户通过电子邮件自动关联 |
| 缺少自定义声明 | 通过 Auth0 Actions 添加声明 |
| 令牌格式不同 | 更新 API 以使用 Auth0 签发者验证 RS256 JWT |
| 会话持久性 | Auth0 使用轮换刷新令牌;更新令牌存储 |
| 用户必须重新登录 | 基于重定向的身份验证预期如此;通知用户 |
导出和导入用户的完整指南:
所有主要框架的前后示例:
auth0-quickstart - 迁移后的初始 Auth0 设置auth0-react - React SPA 集成auth0-nextjs - Next.js 集成auth0-vue - Vue.js 集成auth0-angular - Angular 集成auth0-express - Express.js 集成auth0-react-native - React Native/Expo 集成每周安装量
64
仓库
GitHub 星标
11
首次出现
2026年2月6日
安全审计
安装于
github-copilot56
codex56
gemini-cli55
opencode55
amp52
kimi-cli52
Migrate users and authentication flows from existing auth providers to Auth0.
auth0-quickstart for new projects without existing usersCheck if the project already has authentication:
Search for common auth-related patterns in the codebase:
| Pattern | Indicates |
|---|---|
signInWithEmailAndPassword, onAuthStateChanged | Firebase Auth |
useUser, useSession, isSignedIn | Existing auth hooks |
passport.authenticate, LocalStrategy | Passport.js |
authorize, getAccessToken, oauth |
If existing auth detected, ask:
I detected existing authentication in your project. Are you:
- Migrating to Auth0 (replace existing auth)
- Adding Auth0 alongside (keep both temporarily)
- Starting fresh (remove old auth, new Auth0 setup)
Export users from your current provider. See User Import Guide for detailed instructions:
Required data per user:
Import users via Dashboard, CLI, or Management API.
Quick start:
# Via Auth0 CLI
auth0 api post "jobs/users-imports" \
--data "connection_id=con_ABC123" \
--data "users=@users.json"
For detailed instructions:
Update your application code to use Auth0 SDKs.
SeeCode Migration Patterns for detailed before/after examples:
Frontend:
Backend:
Provider-Specific:
After migrating code, use framework-specific skills:
auth0-react for React applicationsauth0-nextjs for Next.js applicationsauth0-vue for Vue.js applicationsauth0-angular for Angular applicationsauth0-express for Express.js applicationsauth0-react-native for React Native/Expo applicationsIf your API validates JWTs, update to validate Auth0 tokens.
Key differences:
https://YOUR_TENANT.auth0.com/https://YOUR_TENANT.auth0.com/.well-known/jwks.jsonSeeJWT Validation Examples for:
For production applications with active users, use a phased approach:
Support both Auth0 and legacy provider simultaneously:
// Support both providers during migration
const getUser = async () => {
// Try Auth0 first
const auth0User = await getAuth0User();
if (auth0User) return auth0User;
// Fall back to legacy provider
return await getLegacyUser();
};
| Issue | Solution |
|---|---|
| Password hashes incompatible | Use Auth0 custom DB connection with lazy migration |
| Social logins don't link | Configure same social connection, users auto-link by email |
| Custom claims missing | Add claims via Auth0 Actions |
| Token format different | Update API to validate RS256 JWTs with Auth0 issuer |
| Session persistence | Auth0 uses rotating refresh tokens; update token storage |
| Users must re-login | Expected for redirect-based auth; communicate to users |
Complete guide to exporting and importing users:
Before/after examples for all major frameworks:
auth0-quickstart - Initial Auth0 setup after migrationauth0-react - React SPA integrationauth0-nextjs - Next.js integrationauth0-vue - Vue.js integrationauth0-angular - Angular integrationauth0-express - Express.js integrationauth0-react-native - React Native/Expo integrationWeekly Installs
64
Repository
GitHub Stars
11
First Seen
Feb 6, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot56
codex56
gemini-cli55
opencode55
amp52
kimi-cli52
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
130,600 周安装
DOCX 生成器 - 自动化 Word 文档生成与模板替换工具 | Deno 技能
355 周安装
Vapi API 创建通话教程:外拨电话、网页通话、批量通话编程指南
364 周安装
技术分析师技能:纯图表驱动的周线技术分析,识别趋势支撑阻力,制定概率化交易情景
364 周安装
AI 驱动的系统性文献综述写作工具 - 支持 LaTeX/BibTeX 输出,提升学术研究效率
365 周安装
Apollo Federation 模式编写指南:Federation 2 核心指令与最佳实践
363 周安装
LaTeX 研究海报制作指南:专业学术海报设计模板与AI示意图生成
365 周安装
| OAuth/OIDC |
JWT, jwt.verify, jsonwebtoken | Token-based auth |
/api/auth/, /login, /callback | Auth routes |