We value your privacy

This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content. See our Privacy Policy.

  1. MooseStack
  2. Configuration
  3. Admin API Authentication

Admin API Authentication

Configure authentication for the Admin API. The Moose CLI uses a plain-text token from your local environment to authenticate against your production instance, which validates it using a stored hash.

Configuration Reference

KeyEnv VariableDefaultDescription
admin_api_keyMOOSE_AUTHENTICATION__ADMIN_API_KEY-Server-side. PBKDF2 hash of the admin token for validating requests.
admin_tokenMOOSE_ADMIN_TOKEN-Client-side. Plain-text token used by the CLI to authenticate against the Admin API.

Admin API Key (Server-Side)

Store the PBKDF2 hash of the admin token on your production instance:

moose.config.toml
[authentication]# Optional hashed admin API key for auth (Default: None)# admin_api_key = "hashed_api_key"

Or set it as an environment variable:

MOOSE_AUTHENTICATION__ADMIN_API_KEY=your_pbkdf2_hmac_sha256_hashed_key
MooseTip:

The admin_api_key stores a PBKDF2 hash, not the plain-text token. It is safe to commit this hashed value to version control since the Bearer token cannot be derived from it.

Admin Token (Client-Side)

Store the plain-text token in your local .env.local file. The CLI uses this token to authenticate API requests to your production Admin API:

MOOSE_ADMIN_TOKEN=your_plain_text_token
Warning:

The admin_token contains a plain-text token and must never be committed to version control. Store it only in your git-ignored .env.local file.

On this page

Configuration ReferenceAdmin API Key (Server-Side)Admin Token (Client-Side)
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackHostingTemplatesGuides
Release Notes
Source531
  • Overview
Build a New App
  • 5 Minute Quickstart
  • Browse Templates
  • Existing ClickHouse
Add to Existing App
  • Next.js
  • Fastify
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Language Server
  • Data Modeling
Moose Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs & Web Apps
Deployment & Lifecycle
  • Moose Dev
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
    • Core Settings
    • Project Settings
    • TypeScript
    • Telemetry
    • Git
    • Features
    • Migrations
    • Docker
    • Infrastructure
    • ClickHouse
    • Redpanda
    • Redis
    • Temporal
    • HTTP Server
    • State Storage
    • Security
    • JWT
    • Admin API
    • Development
    • Dev Environment
  • Observability Metrics
  • Help
  • Release Notes
Contribution
  • Documentation
  • Framework