POST /auth/login
Authenticates a user with username and password credentials and returns a JWT token for subsequent API requests. Authentication: None required (public endpoint) Source:LoginController.java:21
Request
Username for authentication. Must be between 3 and 50 characters.Validation:
- Required field
- Minimum length: 3 characters
- Maximum length: 50 characters
User password. Must be between 1 and 100 characters.Validation:
- Required field
- Minimum length: 1 character
- Maximum length: 100 characters
Response
JWT authentication token. Include this token in the
Authorization header as Bearer {token} for authenticated requests.Employee information associated with the authenticated user.
Array of UI permission strings that determine which features and sections the user can access in the application.
Error Responses
Returned when credentials are invalid or user is not found.
Returned when request validation fails (e.g., missing fields, invalid format).
Examples
Success Response Example
Using the JWT Token
After successful authentication, include the JWT token in all subsequent API requests:JWT tokens have an expiration time. When a token expires, the client must re-authenticate using this login endpoint to obtain a new token.