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.

post/login

Request

Query parameters

cookie_max_ageinteger

Request body application/x-www-form-urlencoded

grant_typestring nullable
usernamestring required
passwordstring password required
scopestring
client_idstring nullable
client_secretstring password nullable

Response

Successful Response

access_tokenstring required
refresh_tokenstring required
token_typestring required

Changes

    • breaking

      the request property format changed from no format to password

    • breaking

      the request property format changed from no format to password

    • breaking

      the response's body type changed from no type to object for status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • breaking

      the request property format changed from password to no format

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • info

      the request property format was generalized from password to no format