Labsco
auth0 logo

auth0-java-mvc-common

37

by auth0 · part of auth0/agent-skills

Use when adding Auth0 login, logout, and callback handling to Java Servlet web applications - integrates com.auth0:mvc-auth-commons SDK for server-side Java…

🔥🔥🔥✓ VerifiedFreeQuick setup
🧩 One of 7 skills in the auth0/agent-skills package — works on its own, and pairs well with its siblings.

Use when adding Auth0 login, logout, and callback handling to Java Servlet web applications - integrates com.auth0:mvc-auth-commons SDK for server-side Java…

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by auth0

Use when adding Auth0 login, logout, and callback handling to Java Servlet web applications - integrates com.auth0:mvc-auth-commons SDK for server-side Java… npx skills add https://github.com/auth0/agent-skills --skill auth0-java-mvc-common Download ZIPGitHub37

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:

Copy & paste — that's it
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.

When NOT to Use

Use Case Recommended Skill Spring Boot web applications with auto-configuration Use 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 Applications Use auth0-react, auth0-vue, or auth0-angular for client-side auth Mobile applications Use auth0-android or auth0-swift for native mobile Machine-to-machine API calls Use Auth0 Management API SDK for server-to-server

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