TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/miagv/PlataformaEduca/llms.txt
Use this file to discover all available pages before exploring further.
/api/auth/login endpoint validates a user’s credentials and returns a signed JWT token. This token must be included in the Authorization header of all subsequent requests to protected endpoints. Tokens are valid for 24 hours (86,400,000 ms); once expired, you must call this endpoint again to obtain a new one.
Endpoint
application/json
Request body
The user’s registered email address.
The user’s plain-text password. Always transmit over HTTPS.
Example request
Response
200 OK
Returns aJwtResponse object containing the signed token and the authenticated user’s identity.
The signed JWT token. Include this in all subsequent requests as
Authorization: Bearer <token>. The token encodes the user’s email and roles, and expires after 24 hours.The email address of the authenticated user.
List of role names assigned to the user, each prefixed with
ROLE_. For example: ["ROLE_COORDINADOR"]. These roles control access to protected endpoints.Example success response
Using the token
Include the token in theAuthorization header for every request to a protected endpoint:
- Header format:
Authorization: Bearer <token> - Expiry: Tokens expire after 24 hours (86,400,000 ms). Call
/api/auth/loginagain to get a fresh token. - Role enforcement: The roles embedded in the token determine which endpoints you can access. Attempting to reach an endpoint that requires a higher role returns
403 Forbidden.
Store the JWT token securely. Do not persist it in
localStorage in browser environments — prefer sessionStorage or an in-memory store to reduce XSS exposure. In server-side or mobile contexts, use a secure secrets store or the platform’s secure storage API. Never log or expose the token in client-side error messages.Error responses
| Status | Cause |
|---|---|
401 Unauthorized | Invalid email or password. Spring Security returns a 401 with no body or a standard error response. |
403 Forbidden | The token is valid but the user’s role does not have permission to access the requested endpoint. |
Test accounts
The following seeded accounts are available for development and testing:| Password | Role | |
|---|---|---|
| admin@gmail.com | admin123 | ADMIN |
| coord@gmail.com | coord123 | COORDINADOR |
| profe@gmail.com | profe123 | DOCENTE |
| alumno@gmail.com | alumno123 | ESTUDIANTE |