Skip to main content
POST
/
manager
/
login
curl -X POST "http://localhost:5001/manager/login" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "admin",
    "password": "your_password"
  }'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expire": 3600,
  "user": {
    "username": "admin",
    "role": "administrator",
    "permissions": ["read", "write", "admin"]
  }
}

Overview

Manager user login interface for obtaining access tokens for the management backend.

Request Body

Required Parameters

username
string
required
Manager username
password
string
required
Manager password
curl -X POST "http://localhost:5001/manager/login" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "admin",
    "password": "your_password"
  }'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expire": 3600,
  "user": {
    "username": "admin",
    "role": "administrator",
    "permissions": ["read", "write", "admin"]
  }
}

Response Fields

token
string
required
Access token for authentication in subsequent API calls
expire
integer
required
Token expiration time (seconds)
user
object
required
User information

Status Codes

Status CodeDescription
200Login successful
401Invalid username or password
429Too many login attempts
500Internal server error

Best Practices

  1. Password Security: Use strong password policies, change passwords regularly
  2. Token Management: Implement automatic token refresh mechanism
  3. Access Control: Role-based and permission-based access control
  4. Login Restrictions: Implement login attempt limits
  5. Session Management: Set reasonable token expiration times
  6. Secure Storage: Don’t store sensitive information in insecure places