To set up authentication for your API, follow these steps:

1. Authentication Methods

Choose from the following options:

  • OAuth2 🟢 (Recommended for third-party integrations)
  • JWT 🔒 (Ideal for stateless token-based access)
  • API Key ⚙️ (Simple for internal services)

⚠️ Always enable HTTPS to secure sensitive data.

2. Configuration Steps

  1. Enable Authentication

    curl -X POST https://api.example.com/management/auth/enable
    

    ✅ This activates the chosen method.

  2. Set Secret Key

    curl -X PUT https://api.example.com/management/auth/secret -d "your_secure_key"
    

    ❗️ Replace your_secure_key with a strong, unique value.

  3. Test Credentials
    Use the /test endpoint to validate your setup:
    Test Authentication Configuration

3. Security Best Practices

  • 🔒 Rotate keys regularly
  • 📊 Monitor failed login attempts
  • 🛡️ Restrict IP ranges for key-based access

OAuth2_Flow

OAuth2 authentication flow diagram

For advanced settings, refer to our API Security Guide.
Configure Authentication (Chinese)