Files
orion/docs/api/authentication.md

1.2 KiB

Authentication

JWT-based authentication system for the FastApi Multitenant eCommerce API.

Overview

The API uses JSON Web Tokens (JWT) for authentication. Users must register, login to receive a token, then include the token in subsequent requests.

Authentication Flow

  1. Register - Create a new user account
  2. Login - Authenticate and receive JWT token
  3. Use Token - Include token in API requests

Endpoints

Register User

POST /api/v1/auth/register
Content-Type: application/json

{
  "email": "user@example.com",
  "username": "testuser",
  "password": "securepassword123"
}

Login

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

{
  "username": "testuser",
  "password": "securepassword123"
}

Response:

{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "token_type": "bearer",
  "expires_in": 86400
}

Using Authentication

Include the JWT token in the Authorization header:

GET /api/v1/marketplace/product
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...

User Roles

  • User - Basic access to own resources
  • Admin - Full system access

This documentation is under development.