Skip to content
Skills Library
Programming · Tool integration

auth0

/auth0

Expert Auth0 authentication assistance covering OAuth2, OpenID Connect, JWT validation, and RBAC. Use when integrating Auth0 into web/mobile apps, configuring Universal Login, or securing APIs.

Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
10
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Expert Auth0 authentication assistance covering OAuth2, OpenID Connect, JWT validation, and RBAC. Use when integrating Auth0 into web/mobile apps, configuring Universal Login, or securing APIs.

Original author description

Expert Auth0 authentication assistance covering OAuth2, OpenID Connect, JWT validation, and RBAC. Use when integrating Auth0 into web/mobile apps, configuring Universal Login, or securing APIs.

How it works

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Original SKILL.md headings · 154 lines, 606 words
SKILL.md preview
---
name: auth0
description: Expert Auth0 authentication assistance covering OAuth2, OpenID Connect, JWT validation, and RBAC. Use when integrating Auth0 into web/mobile apps, configuring Universal Login, or securing APIs.
---

# Auth0

Auth0 is a platform for authentication and authorization. It provides a Universal Login page that handles the complexity of authentication protocols (SAML, OIDC, OAuth) and identity providers (Google, Enterprise, Database).

## When to Use

- **Enterprise Universal Login**: Outsourcing authentication, MFA, and social/enterprise federated logins to managed Auth0 infrastructure.
- **B2B Multi-Tenant Identity**: Managing distinct organizational customer portals with custom domains, SAML/WS-Fed, and SCIM provisioning.
- **Fine-Grained Role-Based Access Control**: Defining custom roles, permissions, and claims enforced across APIs and frontends.
- **Machine-to-Machine (M2M) Authorization**: Securing daemon background services using OAuth 2.0 Client Credentials grants.

## Quick Start

```bash
npm install @auth0/nextjs-auth0
```

```javascript
// page/api/auth/[...auth0].js
import { handleAuth } from '@auth0/nextjs-auth0';
export default handleAuth();

// Component
import { useUser } from '@auth0/nextjs-auth0/client';

export default function Profile() {
  const { user, error, isLoading } = useUser();
  if (isLoading) return <div>Loading...</div>;
  if (user) return <div>Welcome {user.name}</div>;
  return <a href="/api/auth/login">Login</a>;
}
```

## Core Concepts

### Auth0 Universal Login & OIDC Handshake

Clients redirect to centralized Auth0 login pages, preventing direct credential exposure to frontend applications:

```typescript
// Next.js App Router Auth0 SDK (v3)
import { handleAuth, handleLogin } from "@auth0/nextjs-auth0";

export const GET = handleAuth({
  login: handleLogin({
    authorizationParams: {
      audience: "https://api.myenterprise.com",
      scope: "openid profile email read:reports",
    },
    returnTo: "/dashboard",
  }),
});
```

### Auth0 Actions (Extensibility Pipeline)

Node.js event handlers executed during the authentication pipeline to enrich claims, enforce MFA, or check blocklists:

```javascript
// Auth0 Post-Login Action
exports.onExecutePostLogin = async (event, api) => {
  const namespace = "https://myenterprise.com/claims";
  // Add custom roles to the ID and Access Tokens
  if (event.authorization?.roles) {
    api.idToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
    api.accessToken.setCustomClaim(
      `${namespace}/roles`,
      event.authorization.roles,
    );
  }

  // Conditionally trigger MFA for external networks
  if (!event.request.ip.startsWith("10.0.")) {
    api.multifactor.enable("any");
  }
};
```

### Machine-to-Machine JWT Verification in Backend APIs

Validates JWT access tokens against the Auth0 JWKS endpoint:

```typescript
import { expressjwt as jwt } from "express-jwt";
import jwksRsa from "jwks-rsa";

export const checkJwt = jwt({
  secret: jwksRsa.expressJwtSecret({
    cache: true,
    rateLimit: true,
    jwksRequestsPerMinute: 5,
    jwksUri: `https://my-tenant.us.auth0.com/.well-known/jwks.json`,
  }),
  audience: "https://api.myenterprise.com",
  issuer: `https://my-tenant.us.auth0.com/`,
  algorithms: ["RS256"],
});
```

## Common Patterns

### Express JWT Verification Middleware

**Problem**: Securing backend API routes against unauthorized or tampered Auth0 access tokens.

**Solution**:
Use `express-oauth2-jwt-bearer` with audience and issuer verification:

```javascript
import { auth } from "express-oauth2-jwt-bearer";

export const checkJwt = auth({
  audience: "https://api.mycompany.com",
  issuerBaseURL: "https://mytenant.us.auth0.com/",
  tokenSigningAlg: "RS256",
});

// Protect routes
app.get("/api/private", checkJwt, (req, res) => {
  res.json({
    message: "Protected endpoint access granted",
    user: req.auth.payload,
  });
});
```

## Best Practices

**Do**:

- Always Verify the `audience` and `issuer` Claims: Never validate token signatures without verifying that the audience matches your specific API identifier.
- Use Auth0 Actions instead of Legacy Rules/Hooks: Actions provide modern TypeScript runtimes, secret management, and version history.
- Rotate Signing Secrets Regularly: Use RS256 asymmetric keys with automated JWKS rotation rather than static HS256 shared secrets.
- Enable Anomaly Detection: Turn on brute-force protection, credential stuffing guards, and breached password detection in the Auth0 console.

**Don't**:

- Store sensitive user data in client-side localStorage: Store tokens in secure HttpOnly cookies or use the Auth0 refresh token rotation flow.
- Hardcode client secrets in frontend or mobile apps: Use the Authorization Code Flow with PKCE for single-page and mobile apps.
- Use Auth0 Management API tokens in client code: Keep Management API tokens strictly within secure backend servers.

## Troubleshooting

| Error                   | Cause                          | Solution                                                                |
| :---------------------- | :----------------------------- | :---------------------------------------------------------------------- |
| `Callback URL mismatch` | Redirect URI not in dashboard. | Add `http://localhost:3000/api/auth/callback` to Allowed Callback URLs. |
| `CORS`                  | Calling API from SPA.          | Configure Allowed Origins and Web Origins.                              |

## References

- [Auth0 Documentation](https://auth0.com/docs)
- [Auth0 Next.js SDK](https://github.com/auth0/nextjs-auth0)

Versions

RepositoryScoreLicence
This page · G1Joshi/Agent-Skills100MIT
auth0/agent-skills95Apache-2.0

Database snapshot: 13.11.2026 · package version 60a3e1b283e1 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 96authentica-integration
    Use when integrating Authentica in web or mobile apps.
  • 80role-backend:auth-implementation
    Implements authentication and authorization systems including JWT token management, session handling, OAuth2 flows, OpenID Connect, RBAC/ABAC enforcement, API key management, multi-tenancy auth isolation, SSO integration, and refresh token rotation. Use when building login…
  • 100authentication
    Authentication and authorization for ASP.NET Core. Covers JWT bearer tokens, OpenID Connect, ASP.NET Identity, authorization policies, role and claim-based authorization, and API key authentication. Load this skill when implementing login, protecting endpoints, designing…
  • 100oauth2-oidc
    Assists with implementing OAuth 2.0 and OpenID Connect for secure authentication and authorization. Use when configuring authorization flows, validating tokens, implementing PKCE for public clients, setting up social login, or building secure token handling for SPAs, mobile…
  • 100openid-connect
    Expert OpenID Connect (OIDC) assistance covering ID tokens, UserInfo endpoints, discovery documents, and claims. Use when implementing single sign-on (SSO), verifying ID tokens, or configuring OIDC providers.
  • 100identity-access-expert
    Design authentication and authorisation: OAuth 2.1 and OpenID Connect, session and token handling, RBAC and ABAC, and multi-tenant access control. Use when the user mentions OAuth, OIDC, SAML, SSO, JWT, refresh tokens, PKCE, login flows, sessions, roles and permissions, RBAC or…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.