← 返回 Skills 市场
76
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install auth0-vue
功能描述
Use when adding authentication to Vue.js 3 applications (login, logout, user sessions, protected routes) - integrates @auth0/auth0-vue SDK for SPAs with Vite...
使用说明 (SKILL.md)
Auth0 Vue.js Integration
Add authentication to Vue.js 3 single-page applications using @auth0/auth0-vue.
Prerequisites
- Vue 3+ application (Vite or Vue CLI)
- Auth0 account and application configured
- If you don't have Auth0 set up yet, use the
auth0-quickstartskill first
When NOT to Use
- Server-side rendered Vue apps - See Auth0 Nuxt.js guide for SSR patterns
- Vue 2 applications - This SDK requires Vue 3+, use legacy @auth0/auth0-spa-js wrapper
- Embedded login - This SDK uses Auth0 Universal Login (redirect-based)
- Backend API authentication - Use express-openid-connect or JWT validation instead
Quick Start Workflow
1. Install SDK
npm install @auth0/auth0-vue
2. Configure Environment
For automated setup with Auth0 CLI, see Setup Guide for complete scripts.
For manual setup:
Create .env file:
VITE_AUTH0_DOMAIN=your-tenant.auth0.com
VITE_AUTH0_CLIENT_ID=your-client-id
3. Configure Auth0 Plugin
Update src/main.ts:
import { createApp } from 'vue';
import { createAuth0 } from '@auth0/auth0-vue';
import App from './App.vue';
const app = createApp(App);
app.use(
createAuth0({
domain: import.meta.env.VITE_AUTH0_DOMAIN,
clientId: import.meta.env.VITE_AUTH0_CLIENT_ID,
authorizationParams: {
redirect_uri: window.location.origin
}
})
);
app.mount('#app');
4. Add Authentication UI
Create a login component:
\x3Cscript setup lang="ts">
import { useAuth0 } from '@auth0/auth0-vue';
const { loginWithRedirect, logout, isAuthenticated, user, isLoading } = useAuth0();
\x3C/script>
\x3Ctemplate>
\x3Cdiv>
\x3Cdiv v-if="isLoading">Loading...\x3C/div>
\x3Cdiv v-else-if="isAuthenticated">
\x3Cimg :src="user?.picture" :alt="user?.name" />
\x3Cspan>Welcome, {{ user?.name }}\x3C/span>
\x3Cbutton @click="logout({ logoutParams: { returnTo: window.location.origin }})">
Logout
\x3C/button>
\x3C/div>
\x3Cbutton v-else @click="loginWithRedirect()">
Login
\x3C/button>
\x3C/div>
\x3C/template>
5. Test Authentication
Start your dev server and test the login flow:
npm run dev
Detailed Documentation
- Setup Guide - Automated setup scripts (Bash/PowerShell), CLI commands, manual configuration
- Integration Guide - Protected routes, API calls, error handling, composables
- API Reference - Complete SDK API, configuration options, composables reference, testing strategies
Common Mistakes
| Mistake | Fix |
|---|---|
| Forgot to add redirect URI in Auth0 Dashboard | Add your application URL (e.g., http://localhost:3000, https://app.example.com) to Allowed Callback URLs in Auth0 Dashboard |
| Using wrong env var prefix | Vite requires VITE_ prefix, Vue CLI uses VUE_APP_ |
| Not handling loading state | Always check isLoading before rendering auth-dependent UI |
| Storing tokens in localStorage | Never manually store tokens - SDK handles secure storage automatically |
| Missing createAuth0 plugin registration | Must call app.use(createAuth0({...})) before mounting app |
| Accessing auth before plugin loads | Wrap auth-dependent code in v-if="!isLoading" |
Related Skills
auth0-quickstart- Basic Auth0 setupauth0-migration- Migrate from another auth providerauth0-mfa- Add Multi-Factor Authentication
Quick Reference
Core Composables:
useAuth0()- Main authentication composableisAuthenticated- Reactive check if user is logged inuser- Reactive user profile informationloginWithRedirect()- Initiate loginlogout()- Log out usergetAccessTokenSilently()- Get access token for API calls
Common Use Cases:
- Login/Logout buttons → See Step 4 above
- Protected routes with navigation guards → Integration Guide
- API calls with tokens → Integration Guide
- Error handling → Integration Guide
References
安全使用建议
This skill is coherent with adding Auth0 to Vue 3 apps, but review and run setup steps manually rather than blindly. Specific points to consider before installing/running scripts:
- The automated setup may install the Auth0 CLI (brew/scoop or a curl | sh installer). Inspect the install script (https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh) before executing. Prefer package-manager installs you trust.
- The setup scripts call auth0 login and may create/modify an Auth0 application; that will open a browser and store CLI session tokens locally — this is expected but be aware it grants the CLI access to your Auth0 tenant.
- The scripts append client configuration to your project .env. Confirm the prompt before writing to an existing .env to avoid inadvertently exposing unrelated secrets.
- The client ID and domain are public (not secrets), but you should never place client secrets in client-side .env files.
If you prefer a lower-risk path: skip the automated scripts and manually create an Auth0 SPA application in the Auth0 Dashboard and add VITE_AUTH0_DOMAIN and VITE_AUTH0_CLIENT_ID to your project .env as shown in the docs.
功能分析
Type: OpenClaw Skill
Name: auth0-vue
Version: 1.0.0
The skill bundle provides a legitimate and well-documented integration for Auth0 authentication in Vue.js 3 applications. It includes comprehensive guides and automated setup scripts in 'references/setup.md' that use the official Auth0 CLI to configure the environment. While the scripts perform potentially risky actions such as installing software via 'curl | sh' and modifying '.env' files, these are standard practices for the stated purpose and are accompanied by explicit instructions for the AI agent to prioritize user consent and protect sensitive data from being read into the LLM context.
能力标签
能力评估
Purpose & Capability
Name/description match the instructions: the SKILL.md and reference docs exclusively describe integrating @auth0/auth0-vue into Vue 3 apps, protecting routes, and calling APIs. The guidance to create VITE_AUTH0_DOMAIN and VITE_AUTH0_CLIENT_ID (client ID + domain) is consistent with the purpose; no unrelated services, binaries, or credentials are requested.
Instruction Scope
Runtime instructions stay within scope: they tell the developer to install the SDK, configure the plugin, create .env entries, and optionally use the Auth0 CLI to create/manage an application. The setup docs explicitly warn not to read .env contents and require user confirmation before writing to .env, which limits dangerous scope creep.
Install Mechanism
The skill is instruction-only (no install spec), which is low risk. The automated setup scripts, however, recommend installing the Auth0 CLI via typical package managers (brew, scoop) and include a curl -sSfL https://raw.githubusercontent.com/... | sh pattern for Linux — a common convenience but higher-risk pattern because it downloads and executes a script. The URL is GitHub raw (official project) rather than a personal server, which mitigates but does not eliminate risk. Review the install script before executing.
Credentials
The skill does not request platform-level secrets or list required env vars in its metadata. It instructs creating VITE_ variables in a project .env (public client ID and domain). The automated setup prompts the user to run auth0 login (which will create local CLI session tokens) and writes public client info into .env only after explicit confirmation — behavior proportionate to the described purpose. Be aware that auth0 CLI login will store credentials/tokens locally as part of normal CLI behavior.
Persistence & Privilege
The skill does not request persistent agent-level privileges (always: false) and contains no code that modifies other skills or global agent config. The only persistent changes described are appending to the project's .env and optional installation of the Auth0 CLI via system package managers — both are expected for a developer-facing setup flow and are performed only with user action/consent.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install auth0-vue - 安装完成后,直接呼叫该 Skill 的名称或使用
/auth0-vue触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release: Auth0 authentication integration for Vue.js 3 applications.
- Provides quick start guide for installing and configuring @auth0/auth0-vue SDK.
- Includes setup steps, authentication UI example, and troubleshooting section.
- Links to detailed documentation for setup, integration, and API references.
- Outlines common mistakes and solutions for smoother implementation.
元数据
常见问题
Auth0 Vue 是什么?
Use when adding authentication to Vue.js 3 applications (login, logout, user sessions, protected routes) - integrates @auth0/auth0-vue SDK for SPAs with Vite... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 76 次。
如何安装 Auth0 Vue?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install auth0-vue」即可一键安装,无需额外配置。
Auth0 Vue 是免费的吗?
是的,Auth0 Vue 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Auth0 Vue 支持哪些平台?
Auth0 Vue 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Auth0 Vue?
由 Auth0(@auth0)开发并维护,当前版本 v1.0.0。
推荐 Skills