NetStacksNetStacks

Authentication

API authentication methods.

JWT Authentication

The NetStacks API uses JWT (JSON Web Tokens) for authentication. Include the token in the Authorization header.

Authorization: Bearer eyJhbGciOiJIUzI1NiIs...

Login Endpoint

POST /api/auth/login
Content-Type: application/json

{
  "username": "admin",
  "password": "password"
}

Response:
{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "refresh_token": "eyJhbGciOiJIUzI1NiIs...",
  "expires_in": 3600
}

Token Refresh

POST /api/auth/refresh
Content-Type: application/json

{
  "refresh_token": "eyJhbGciOiJIUzI1NiIs..."
}

Response:
{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "expires_in": 3600
}