Token导航 LogoToken导航

Agent Skill · 开发

auth0-java-mvc-common(auth0 Java MVC common 测试)

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

auth0-java-mvc-common 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在开发类的 21,746 个 Skill 里排第 13,944。

总安装 784周安装 33GitHub Stars 17下载 275核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:auth0-java-mvc-common(auth0 Java MVC common 测试)
来源仓库:https://github.com/auth0/agent-skills
仓库路径:skills/auth0-java-mvc-common
安装命令:
npx skills add https://github.com/auth0/agent-skills --skill auth0-java-mvc-common
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/auth0/agent-skills --skill auth0-java-mvc-common

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。适合分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。通过系统步骤发现项目结构、识别认证文件和中间件配置,提供路由保护建议。

使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码。auth0-java-mvc-common 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/auth0-java-mvc-common

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/auth0/agent-skills --skill auth0-java-mvc-comm…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

auth0-java-mvc-common 怎么安装?

在终端执行 npx skills add https://github.com/auth0/agent-skills --skill auth0-java-mvc-common。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

auth0-java-mvc-common 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

auth0-java-mvc-common 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

auth0-java-mvc-common 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

auth0-java-mvc-common 用的人多吗?

公开数据是累计安装 784 次,近一周安装 33 次,下载 275 次,GitHub 17 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

auth0-java-mvc-common 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
auth0-java-mvc-common

auth0 Java MVC common 测试 · 本页

78417接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Auth0 Java MVC Common Integration

Add Auth0 authentication to Java Servlet web applications using com.auth0:mvc-auth-commons. Provides AuthenticationController for building authorize URLs and handling callbacks, with session-based authentication and support for Organizations and Multiple Custom Domains.


Agent instruction: Before providing SDK setup instructions, fetch the latest release version by running: ``bash gh api repos/auth0/auth0-java-mvc-common/releases/latest --jq '.tag_name' ` Use the returned version in all dependency lines instead of any hardcoded version below. If the API call fails, use 1.12.0`.

Prerequisites

  • Java 8+ (Java 17+ recommended)
  • Servlet container (Tomcat, Jetty, etc.) with javax.servlet 3+
  • Maven 3.6+ or Gradle 7+
  • Auth0 Regular Web Application configured
  • If you don't have Auth0 set up yet, use the auth0-quickstart skill first

When NOT to Use

Use CaseRecommended Skill
Spring Boot web applications with auto-configurationUse Spring Boot + Okta starter for auto-configured Spring Boot login
Spring Boot REST APIs (stateless JWT)Use auth0-springboot-api for JWT Bearer token validation
Single Page ApplicationsUse auth0-react, auth0-vue, or auth0-angular for client-side auth
Mobile applicationsUse auth0-android or auth0-swift for native mobile
Machine-to-machine API callsUse Auth0 Management API SDK for server-to-server

Quick Start Workflow

Agent instruction: If the user's prompt already provides Auth0 credentials (domain, client ID, client secret), use them directly — skip the bootstrap script and credential questions. Only offer setup options when credentials are missing.

1. Install SDK

Gradle (build.gradle):

implementation 'com.auth0:mvc-auth-commons:1.12.0'

Maven (pom.xml):

<dependency>
    <groupId>com.auth0</groupId>
    <artifactId>mvc-auth-commons</artifactId>
    <version>1.12.0</version>
</dependency>

2. Create Auth0 Application

You need a Regular Web Application (not SPA or Native) in Auth0.

STOP — ask the user before proceeding. Ask exactly this question and wait for their answer before doing anything else: > "How would you like to create the Auth0 application? > > 1. Automated — I'll run Auth0 CLI scripts that create the application and write the values to your config automatically. > 2. Manual — You create the application yourself in the Auth0 Dashboard (or via auth0 apps create) and provide me the Domain, Client ID, and Client Secret. > > Which do you prefer? (1 = Automated / 2 = Manual)" Do NOT proceed to any setup steps until the user has answered. Do NOT default to manual.

If the user chose Automated, follow the Setup Guide for complete CLI scripts. The automated path writes configuration for you — skip Step 3 below and proceed directly to Step 4.

If the user chose Manual, follow the Setup Guide (Manual Setup section). Then continue with Step 3.

Quick reference for manual application creation:

# Using Auth0 CLI
auth0 apps create \
  --name "My Java Web App" \
  --type regular \
  --callbacks http://localhost:3000/callback \
  --logout-urls http://localhost:3000

Or create manually in Auth0 Dashboard → Applications → Applications → Create Application → Regular Web Applications

3. Configure Credentials

Store credentials as environment variables (never hardcode in source):

export AUTH0_DOMAIN="your-tenant.auth0.com"
export AUTH0_CLIENT_ID="your-client-id"
export AUTH0_CLIENT_SECRET="your-client-secret"

Or use a .env file (add to .gitignore):

AUTH0_DOMAIN=your-tenant.auth0.com
AUTH0_CLIENT_ID=your-client-id
AUTH0_CLIENT_SECRET=your-client-secret
Agent instruction: Java does not auto-load .env files. System.getenv() only reads OS-level environment variables. If you generate a .env file, you must also either: (1) add dotenv-java as a dependency and use Dotenv.load().get("AUTH0_DOMAIN") instead of System.getenv(), or (2) instruct the user to run source.env before starting the server. Do not generate code that uses both a .env file and System.getenv() without a loading mechanism — the values will be null.

Important: Domain must NOT include https://. The library constructs the issuer URL automatically.

4. Initialize AuthenticationController

Create a singleton AuthenticationController instance:

import com.auth0.AuthenticationController;
import com.auth0.jwk.JwkProviderBuilder;
import com.auth0.jwk.JwkProvider;

public class Auth0Config {

    private static final AuthenticationController controller = createController();

    private static AuthenticationController createController() {
        String domain = System.getenv("AUTH0_DOMAIN");
        String clientId = System.getenv("AUTH0_CLIENT_ID");
        String clientSecret = System.getenv("AUTH0_CLIENT_SECRET");

        JwkProvider jwkProvider = new JwkProviderBuilder(domain).build();

        return AuthenticationController.newBuilder(domain, clientId, clientSecret)
            .withJwkProvider(jwkProvider)
            .build();
    }

    public static AuthenticationController getAuthController() {
        return controller;
    }
}

5. Create Login Servlet

import com.auth0.AuthenticationController;
import com.auth0.AuthorizeUrl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = {"/login"})
public class LoginServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        AuthenticationController controller = Auth0Config.getAuthController();

        // Build callback URL — omit port for standard ports (80/443) to avoid
        // mismatch with the URL registered in Auth0 Dashboard, especially behind proxies.
        String scheme = request.getScheme();
        int port = request.getServerPort();
        String redirectUrl = scheme + "://" + request.getServerName()
            + ((port == 80 || port == 443) ? "" : ":" + port) + "/callback";

        AuthorizeUrl authorizeUrl = controller.buildAuthorizeUrl(request, response, redirectUrl)
            .withScope("openid profile email");

        response.sendRedirect(authorizeUrl.build());
    }
}

6. Create Callback Servlet

import com.auth0.AuthenticationController;
import com.auth0.IdentityVerificationException;
import com.auth0.Tokens;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = {"/callback"})
public class CallbackServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        AuthenticationController controller = Auth0Config.getAuthController();

        try {
            Tokens tokens = controller.handle(request, response);

            request.getSession().setAttribute("accessToken", tokens.getAccessToken());
            request.getSession().setAttribute("idToken", tokens.getIdToken());

            response.sendRedirect("/dashboard");
        } catch (IdentityVerificationException e) {
            response.sendRedirect("/login?error=" + e.getCode());
        }
    }
}

7. Protect Routes with Authentication Middleware (Servlet Filter)

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@WebFilter(urlPatterns = {"/dashboard/*", "/api/private/*"})
public class AuthenticationFilter implements Filter {

    @Override
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
            throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
        HttpSession session = request.getSession(false);

        if (session == null || session.getAttribute("idToken") == null) {
            response.sendRedirect("/login");
            return;
        }

        chain.doFilter(req, res);
    }

    @Override
    public void init(FilterConfig filterConfig) {}

    @Override
    public void destroy() {}
}

8. Test Application

Agent instruction: After writing all code, verify the build succeeds: ``bash ./gradlew build ` or mvn package. If build fails, diagnose and fix. After 5-6 failed attempts, use AskUserQuestion` to get help.
  1. Start the application and navigate to http://localhost:3000/login
  2. You should be redirected to the Auth0 Universal Login page
  3. After login, the callback servlet handles the response and redirects to /dashboard

Common Mistakes

MistakeFix
Domain includes https://Use your-tenant.auth0.com format only — no scheme prefix
Client secret hardcoded in sourceUse environment variables or .env file, add to .gitignore
Created SPA or Native app instead of Regular WebMust create Regular Web Application in Auth0 Dashboard
Callback URL mismatchCallback URL in code must exactly match what's registered in Auth0 Dashboard
Missing openid scopeAlways include openid in the scope — required for ID token
Not handling IdentityVerificationExceptionAlways catch this in the callback handler to show login errors
Using response_type=tokenRegular web apps must use code flow (the default) — never implicit
Session not invalidated on logoutCall request.getSession().invalidate() before redirecting to Auth0 logout

Scope and Audience Configuration

See Integration Guide for requesting custom scopes, audience for API access tokens, and Organizations support.


Multiple Custom Domains (MCD)

Built-in support for routing users to the correct Auth0 domain via DomainResolver. See Integration Guide for configuration.


Related Skills

  • auth0-quickstart — Basic Auth0 setup and account creation
  • auth0-springboot-api — Spring Boot REST APIs with JWT Bearer token validation

Quick Reference

Core Classes:

  • AuthenticationController — Main entry point, builds authorize URLs and handles callbacks
  • AuthenticationController.Builder — Configures the controller via newBuilder(domain, clientId, clientSecret)
  • AuthorizeUrl — Fluent builder for /authorize URL parameters
  • Tokens — Access token, ID token, refresh token from callback
  • IdentityVerificationException — Authentication error with error code
  • DomainResolver — Interface for Multiple Custom Domain support

Builder Methods (AuthorizeUrl):

  • .withScope("openid profile email") — Set requested scopes
  • .withAudience("https://my-api") — Request API access token
  • .withOrganization("org_xxx") — Lock to specific Organization
  • .withInvitation("invite_xxx") — Accept Organization invitation
  • .withConnection("google-oauth2") — Skip to specific connection
  • .withParameter("key", "value") — Add custom authorize parameter

Token Access (Tokens):

  • tokens.getAccessToken() — Access token string
  • tokens.getIdToken() — ID token (JWT) string
  • tokens.getRefreshToken() — Refresh token (if offline_access scope requested)
  • tokens.getExpiresIn() — Token expiration in seconds
  • tokens.getType() — Token type (usually "Bearer")
  • tokens.getDomain() — Auth0 domain that issued the tokens
  • tokens.getIssuer() — Token issuer URL

Detailed Documentation

  • Setup Guide — Auth0 CLI automation, environment configuration, secret management
  • Integration Guide — Organizations, MCD, custom scopes, logout, error handling, advanced patterns
  • API Reference — Complete configuration options, builder methods, claims reference, testing checklist

References

平台分布

Codex

36.96%
按下载量换算102

Claude

27.66%
按下载量换算76

Cursor

18.58%
按下载量换算51

Gemini CLI

9.96%
按下载量换算27

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills