Auth0 Setup
Auth0 Setup
Section titled “Auth0 Setup”TalesMUD uses Auth0 for production authentication. Auth0 handles user registration, login, and JWT issuance. TalesMUD validates JWTs against the Auth0 JWKS endpoint.
Prerequisites
Section titled “Prerequisites”- An Auth0 account (free tier works for small deployments)
Setup Steps
Section titled “Setup Steps”-
Create an Auth0 Application
- Go to Auth0 Dashboard → Applications → Create Application
- Type: Single Page Application
- Name: “TalesMUD” (or your world’s name)
- Note the Domain and Client ID
-
Create an API
- Go to Auth0 Dashboard → APIs → Create API
- Name: “TalesMUD API”
- Identifier:
https://yourdomain.com/api(this becomesAUTH0_AUDIENCE) - Signing Algorithm: RS256
-
Configure Allowed Origins
- In your Auth0 Application settings:
- Allowed Callback URLs:
https://yourdomain.com - Allowed Logout URLs:
https://yourdomain.com - Allowed Web Origins:
https://yourdomain.com
-
Set Environment Variables
Terminal window AUTH_ENABLED=trueAUTH0_AUDIENCE=https://yourdomain.com/apiAUTH0_DOMAIN=https://your-tenant.auth0.com/AUTH0_WK_JWKS=https://your-tenant.auth0.com/.well-known/jwks.json -
Restart the server — Auth0 validation will now be active
Role Assignment
Section titled “Role Assignment”After enabling Auth0, log in with your Admin account and:
- Go to
https://yourdomain.com/admin - Navigate to Users
- Promote your admin account to MUD Admin role
- Promote content creators to MUD Creator role
Players can self-register via Auth0 and automatically get the Player role.
JWT Validation
Section titled “JWT Validation”TalesMUD validates JWTs by:
- Fetching the JWKS (public keys) from
AUTH0_WK_JWKS - Verifying the token signature using the matching key
- Checking the
audclaim matchesAUTH0_AUDIENCE - Checking the
issclaim matchesAUTH0_DOMAIN - Checking the token hasn’t expired
Next Steps
Section titled “Next Steps”- Production Checklist — Pre-launch verification