auth0-integration 0.2.0

Auth0 client library for M2M token retrieval and JWT validation (RS256)
Documentation

auth0-integration

A Rust service for Auth0 integration with JWT validation using RS256.

Features

  • Auth0 client credentials (M2M) authentication flow
  • JWT token validation with JWKS key discovery
  • Async HTTP server with Axum web framework
  • Automatic token refresh and caching
  • Configurable via environment variables

Installation

Add to your Cargo.toml:

[dependencies]
auth0-integration = "0.1"

Configuration

Set these environment variables:

  • AUTH0_DOMAIN - Your Auth0 tenant domain (e.g., your-tenant.us.auth0.com)
  • AUTH0_CLIENT_ID - Machine-to-machine application client ID
  • AUTH0_CLIENT_SECRET - Machine-to-machine application client secret
  • AUTH0_AUDIENCE - API identifier registered in Auth0
  • PORT - HTTP server port (default: 8080)
  • RUST_LOG - Tracing filter (default: auth0_integration=debug,tower_http=debug)

Quick Start

# Copy and configure environment variables
cp .env.example .env

# Build the project
cargo build

# Run the server
cargo run

Docker

docker compose up --build

License

MIT