Loading...
Loading...
Compare original and translation side by side
undefinedundefined
**Framework Detection Table:**
| Framework | Detection | Skill to Use |
|-----------|-----------|--------------|
| React (Vite/CRA) | `"react"` in package.json, no Next.js | `auth0-react` |
| Next.js | `"next"` in package.json | `auth0-nextjs` |
| Vue.js | `"vue"` in package.json, no Nuxt | `auth0-vue` |
| Angular | `angular.json` exists or `"@angular/core"` | `auth0-angular` |
| Express.js | `"express"` in package.json | `auth0-express` |
| React Native | `"react-native"` or `"expo"` in package.json | `auth0-react-native` |
**Don't see your framework?** See Tier 2 Frameworks below.
---
**框架检测对照表:**
| 框架 | 检测方式 | 要使用的Skill |
|-----------|-----------|--------------|
| React (Vite/CRA) | package.json中包含`"react"`,且无Next.js | `auth0-react` |
| Next.js | package.json中包含`"next"` | `auth0-nextjs` |
| Vue.js | package.json中包含`"vue"`,且无Nuxt | `auth0-vue` |
| Angular | 存在`angular.json`或包含`"@angular/core"` | `auth0-angular` |
| Express.js | package.json中包含`"express"` | `auth0-express` |
| React Native | package.json中包含`"react-native"`或`"expo"` | `auth0-react-native` |
**未找到你的框架?** 请查看下方的二级框架。
---brew install auth0/auth0-cli/auth0scoop install auth0brew install auth0/auth0-cli/auth0scoop install auth0
**Full installation guide:** See [CLI Reference](references/cli.md#installation)
**完整安装指南:** 查看[CLI参考文档](references/cli.md#installation)auth0 loginauth0 loginauth0 apps create --name "My App" --type spa \
--callbacks "http://localhost:3000" \
--logout-urls "http://localhost:3000"auth0 apps create --name "My App" --type regular \
--callbacks "http://localhost:3000/api/auth/callback" \
--logout-urls "http://localhost:3000"auth0 apps create --name "My App" --type native \
--callbacks "myapp://callback" \
--logout-urls "myapp://logout"auth0 apps list # Find your app
auth0 apps show <app-id> # Get client ID and secretauth0 apps create --name "My App" --type spa \
--callbacks "http://localhost:3000" \
--logout-urls "http://localhost:3000"auth0 apps create --name "My App" --type regular \
--callbacks "http://localhost:3000/api/auth/callback" \
--logout-urls "http://localhost:3000"auth0 apps create --name "My App" --type native \
--callbacks "myapp://callback" \
--logout-urls "myapp://logout"auth0 apps list # 查找你的应用
auth0 apps show <app-id> # 获取客户端ID和密钥auth0-reactauth0-nextjsauth0-vueauth0-angularauth0-expressauth0-react-nativeauth0-reactauth0-nextjsauth0-vueauth0-angularauth0-expressauth0-react-nativeauth0-migrationauth0-migration| Mistake | Fix |
|---|---|
| Wrong application type | SPAs need "Single Page Application", server apps need "Regular Web Application", mobile needs "Native" |
| Callback URL not configured | Add your app's callback URL to Allowed Callback URLs in Auth0 Dashboard |
| Using wrong credentials | Client Secret only needed for Regular Web Apps, not SPAs |
| Hardcoding credentials in code | Always use environment variables, never commit secrets to git |
| Not testing locally first | Set up localhost URLs in Auth0 before deploying to production |
| Mixing application types | Don't use SPA SDK for server-side apps or vice versa |
| 错误 | 修复方案 |
|---|---|
| 错误的应用类型 | 单页应用需选择“Single Page Application”,服务器应用需选择“Regular Web Application”,移动应用需选择“Native” |
| 未配置回调URL | 在Auth0控制台的“Allowed Callback URLs”中添加你的应用回调URL |
| 使用错误的凭证 | 仅常规Web应用需要Client Secret,单页应用不需要 |
| 在代码中硬编码凭证 | 始终使用环境变量,切勿将密钥提交至git |
| 未先在本地测试 | 部署到生产环境前,先在Auth0中配置localhost URL |
| 混合应用类型 | 不要为服务器端应用使用SPA SDK,反之亦然 |
auth0-migrationauth0-migrationauth0-reactauth0-nextjsauth0-vueauth0-angularauth0-expressauth0-react-nativeauth0-reactauth0-nextjsauth0-vueauth0-angularauth0-expressauth0-react-nativeauth0-mfaauth0-organizationsauth0-passkeysauth0-flowsauth0-enterpriseauth0-mfaauth0-organizationsauth0-passkeysauth0-flowsauth0-enterprise