Authentication

Add authentication to your mock endpoints.

Authentication Types

Mockario supports various authentication types:

JWT (JSON Web Token)

JSON
{
  "path": "/api/protected",
  "method": "GET",
  "auth": {
    "type": "jwt",
    "secret": "your-secret-key"
  }
}

API Key

JSON
{
  "path": "/api/protected",
  "method": "GET",
  "auth": {
    "type": "apiKey",
    "header": "X-API-Key",
    "key": "your-api-key"
  }
}

Basic Auth

JSON
{
  "path": "/api/protected",
  "method": "GET",
  "auth": {
    "type": "basic",
    "username": "admin",
    "password": "password"
  }
}

Bearer Token

JSON
{
  "path": "/api/protected",
  "method": "GET",
  "auth": {
    "type": "bearer",
    "token": "your-bearer-token"
  }
}

Automatic Auth Routes

Mockario automatically creates authentication routes:

  • POST /api/auth/register - Create user
  • POST /api/auth/login - Login
  • GET /api/auth/me - Get current user

Manage Users

You can create and manage users through the web interface or API.

mockario.com

Security

These are mock endpoints. Do not use in production! Passwords and tokens are stored in a simplified manner.