Overview
Wolfix.Server uses JWT (JSON Web Tokens) for authentication. The API supports multiple authentication methods:- Email/Password authentication
- Google OAuth authentication
- Role-based authorization
Authentication Flow
1. Register or Login
First, register a new account or login with existing credentials to receive available roles.2. Get Role-Specific Token
Use the role selection endpoint to get a JWT token for a specific role (Customer, Seller, Admin, etc.).3. Use Token in Requests
Include the JWT token in the Authorization header for authenticated requests:Authorization Roles
The API supports the following roles:- Customer - Regular customers who can browse and purchase products
- Seller - Sellers who can manage their shops and products
- Admin - Administrators who can manage categories and seller applications
- SuperAdmin - Super administrators with full system access
- Support - Support staff who can manage customer requests
Token Lifecycle
Authentication Methods
Email/Password
Standard authentication using email and password credentials. Endpoint:POST /api/account/roles
Request:
Google OAuth
Authenticate using Google Sign-In. Endpoint:POST /api/account/customer/google
Request:
Get Role Token
After login, select a role to receive a JWT token. Endpoint:POST /api/account/token
Request:
Protected Endpoints
Endpoints requiring authentication will return:401 Unauthorized- Missing or invalid token403 Forbidden- Valid token but insufficient permissions
Security Best Practices
Tokens should be stored securely on the client side (e.g., in httpOnly cookies or secure storage).