TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AC42027/Backend-produccion/llms.txt
Use this file to discover all available pages before exploring further.
/api/login-ldap/ endpoint authenticates a user against your corporate Active Directory via LDAP. On success, Django creates or updates a local user record and issues a sessionid session cookie that you must include on all subsequent requests. This endpoint is the only one that does not require an existing session.
Method: POSTPath:
/api/login-ldap/Auth required: No
CORS preflight: Yes — the endpoint responds to
OPTIONS requests with {"status": "ok"} so browser clients can complete the preflight before sending credentials.
Request body
Send a JSON object with the following fields:Your Active Directory
sAMAccountName (e.g. "ac17157"). This is the short login name used to bind to the LDAP server, not an email address.Your Active Directory password.
Response
200 — Success
Always
"ok" on a successful login.Always
"Login exitoso" on success.The user’s first name as resolved from Active Directory (
givenName attribute).The user’s last name as resolved from Active Directory (
sn attribute).Set-Cookie header containing the sessionid cookie. Store this cookie and send it with every subsequent request.
Error responses
| HTTP status | status | message | Cause |
|---|---|---|---|
401 | "error" | "Credenciales inválidas" | Username or password rejected by the LDAP server. |
400 | "error" | "Formato JSON inválido" | Request body could not be parsed as JSON. |
405 | "error" | "Método no permitido. Se requiere POST." | Request used GET or any method other than POST. |
Example
Log in and save the session cookie to a file so you can reuse it in subsequent requests:cookies.txt file now contains the sessionid cookie. Pass -b cookies.txt to any subsequent curl command to authenticate those requests.
The endpoint returns
{"status": "ok"} for OPTIONS (CORS preflight) requests without performing any authentication. This is required by browser clients such as Next.js that send a preflight before every cross-origin POST.