Skip to content

docs: show HTTP Basic authentication with custom clients - #762

Open
AgiKukudala wants to merge 1 commit into
ollama:mainfrom
AgiKukudala:docs/basic-auth-custom-client
Open

AgiKukudala wants to merge 1 commit into
ollama:mainfrom
AgiKukudala:docs/basic-auth-custom-client

Conversation

@AgiKukudala

Copy link
Copy Markdown

Document how to connect to an Ollama instance behind a reverse proxy requiring HTTP Basic authentication. The custom-client section currently mentions forwarded HTTPX kwargs but does not show the supported auth=httpx.BasicAuth(...) configuration; credentials embedded in the host URL are discarded by host parsing.

Add a complete example using environment variables for credentials and a context manager, and note that the same argument works with AsyncClient. This documents the approach recommended in the maintainer discussion on #61 without changing host parsing.

Validation: executed the README example using HTTPX MockTransport, verified the outgoing Basic authorization header and response, and verified the same configuration with AsyncClient. No live server, credentials, or model API requests were used. git diff --check passed.

Prepared with assistance from OpenAI Codex; the example and diff were reviewed locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant