auth0
Skill15 starsChanged 2 months agoMITView on GitHub
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.
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- Ghost7802/awesome-api-skillstheir own version, first seen Nov 29, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- Ghost7802/awesome-api-skills★ 13same name
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 112
Use express-oauth2-jwt-bearer with audience and issuer verification:
- Very specific: line 136
Always Verify the audience and issuer Claims: Never validate token signatures without verifying that the audience matches your specific API …
- Distinctive: line 137
Use Auth0 Actions instead of Legacy Rules/Hooks: Actions provide modern TypeScript runtimes, secret management, and version history.
- Distinctive: line 145
Use Auth0 Management API tokens in client code: Keep Management API tokens strictly within secure backend servers.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
npm install @auth0/nextjs-auth0// 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:
// 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:
// 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:
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:
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
audienceandissuerClaims: 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

