diff --git a/docs/usage.rst b/docs/usage.rst index 1cb5350..471ebc0 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -35,7 +35,19 @@ You can specify these prefixes using ``qido_url_prefix``, ``wado_url_prefix``, a ) -To interact with server requiring authentication, you can provide your credentials using the ``username`` and ``password`` arguments. +To interact with servers requiring authentication, ``DICOMwebClient`` accepts arbitrary authentication handlers derived from ``requests.auth.AuthBase`` (see `here `_ for details). + +.. code-block:: python + + from requests.auth import HTTPBasicAuth + from dicomweb_client.api import DICOMwebClient + + client = DICOMwebClient( + url="https://mydicomwebserver.com", + auth=HTTPBasicAuth('myusername', 'mypassword') + ) + +To simplify usage for ``HTTPBasicAuth``, you may also directly provide a username and password using the corresponding arguments. .. code-block:: python