#34076 [Feature]: allow overriding the UI login authentication with a custom function (`custom_ui_auth`)
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### The Feature
Add a `custom_ui_auth` option to `general_settings` in the proxy config, similar to the existing `custom_auth` option. When set, it points to a custom async function with the signature `async def custom_ui_auth(request, username, password) -> UserAPIKeyAuth` that the proxy calls instead of the built-in `authenticate_user` whenever a user logs into the Admin UI (both `POST /login` and `POST /v2/login`).
```yaml general_settings: custom_ui_auth: custom_ui_auth.custom_ui_auth ```
```python # custom_ui_auth.py from fastapi import Request from litellm.proxy._types import UserAPIKeyAuth
async def custom_ui_auth(request: Request, username: str, password: str) -> UserAPIKeyAuth: # validate username/password against your own identity provider ... return UserAPIKeyAuth(user_id=..., user_email=..., user_role=...) ```
### Motivation, pitch
`custom_auth` already lets you replace `user_api_key_auth` for API requests, but the Admin UI login form (`/login` and `/v2/login`) always calls the built-in `authenticate_user`, which only checks the mas…