---
title: "Login"
method: POST
path: "/login"
---

# Login

`POST /login`

Login to get an authentication token.

Return an access token in the response and a cookie storing a refresh token.

Args:
    form_data (Annotated[OAuth2PasswordRequestForm, Depends()]):
        The form data to authenticate the user.
    session (Annotated[Session, Depends(get_db)]): The database session.
    cookie_max_age (int): the lifetime of the cookie storing the refresh token.

## Query parameters

- `cookie_max_age` integer

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

## Changes

- **2025-05-20** `bbcc40488a72` — 5 breaking, 1 info
  - the `client_secret` request property format changed from `password` to no format
  - the response's body type changed from `object` to no type for status `200`
  - removed the required property `access_token` from the response with the `200` status
  - removed the required property `refresh_token` from the response with the `200` status
  - …2 more

[Change history](https://skmtc.dev/industrial-optimization-group/apis/desdeo-fast-api/changes/login/post.md)

---

[API](https://skmtc.dev/industrial-optimization-group/apis/desdeo-fast-api.md) · [All operations](https://skmtc.dev/industrial-optimization-group/apis/desdeo-fast-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/industrial-optimization-group/desdeo-fast-api/revisions/bbcc40488a72/schema)
