POST /utils/login/access-token
OAuth2 compatible token login, get an access token for future requests
Authenticates a user using OAuth2 password flow and returns an access token for subsequent API requests.
Endpoint
POST /utils/login/access-token
Parameters
| Name | Type | Description |
|---|---|---|
| session | SessionDep | The database session dependency used for user lookup and authentication. |
| form_data | OAuth2PasswordRequestForm | The OAuth2 compatible form data containing the user's credentials. |
Request Body
| Field | Type | Description |
|---|---|---|
| username | string | The email address of the user attempting to log in. |
| password | string | The plain-text password of the user attempting to log in. |
Response
| Status | Description |
|---|---|
| 200 | Successful authentication and token generation. Returns Token. |
| 400 | Returned if the credentials are incorrect or if the user account is currently inactive. Returns JSON. |