Documentation Index
Fetch the complete documentation index at: https://mintlify.com/marchena96/Paradigma-lab1/llms.txt
Use this file to discover all available pages before exploring further.
POST /login is the only public authentication endpoint in the LibraryService API. Submit a valid email and password in the request body to receive a signed JWT Bearer token. The token is valid for 1 hour from the time of issuance and must be included as a Bearer token in the Authorization header of any subsequent requests to protected endpoints.
Endpoint
POST /login
Authentication
No authentication is required ([AllowAnonymous]). This endpoint is intentionally open so that clients can obtain a token.
Request Body
The user’s email address or username used to authenticate.
The user’s password.
The user’s role. Optional — included for compatibility with the
User DTO shape but not evaluated during login.Status Codes
| Status | Meaning |
|---|---|
200 OK | Credentials are valid; the response body contains the signed JWT token. |
401 Unauthorized | The supplied email or password is incorrect. |
Response Fields
The signed JWT Bearer token. Include this value in the
Authorization: Bearer <token> header for all authenticated requests.Example Request
Example Response
Token Properties
| Property | Value |
|---|---|
| Algorithm | HS256 (HMAC SHA-256) |
| Expiry | 1 hour from issuance |
| Claims | NameIdentifier (user ID), Email, Role |