Skip to main content

Endatix JWT Customization

The built-in Endatix JWT provider offers secure, stateless authentication with full customization options. This guide shows you how to configure and customize JWT authentication for your specific needs.

Overview​

The Endatix JWT provider is automatically included and provides:

  • Stateless Authentication: No server-side session storage required
  • Secure Token Handling: Server-side only, never exposed to client
  • Automatic Integration: Seamless communication between Hub and API
  • Flexible Configuration: Customizable token lifetimes and validation

Basic Configuration​

EndatixAPI Configuration (appsettings.json)​

// appsettings.Development.json
{
"Endatix": {
"Auth": {
"Providers": {
"EndatixJwt": {
"Enabled": true,
"SigningKey": "{JWT_SIGNING_KEY}",
"AccessExpiryInMinutes": 900,
"RefreshExpiryInDays": 7,
"Issuer": "https://localhost:5001"
}
}
}
}
}

Use {JWT_SIGNING_KEY} or user secrets — never commit production signing keys. See auth settings for generating and storing a local key.

Endatix Hub Configuration​

The Endatix JWT provider is automatically registered - no additional setup required. Set these in the Hub .env file:

# .env
# Required, at least 32 bytes. Generate your own with `openssl rand -base64 32` or `npx auth secret`
AUTH_SECRET=<your-generated-secret>

# Needed for production deployment to ensure the authentication works correctly under reverse proxy - https://authjs.dev/getting-started/deployment
AUTH_TRUST_HOST=true