Skip to content

Commit fc7e5e6

Browse files
authored
Add documentation on usage of auth parameter (#9)
1 parent 1b18dc4 commit fc7e5e6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/usage.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,19 @@ You can specify these prefixes using ``qido_url_prefix``, ``wado_url_prefix``, a
3535
)
3636
3737
38-
To interact with server requiring authentication, you can provide your credentials using the ``username`` and ``password`` arguments.
38+
To interact with servers requiring authentication, ``DICOMwebClient`` accepts arbitrary authentication handlers derived from ``requests.auth.AuthBase`` (see `here <http://docs.python-requests.org/en/master/user/authentication/>`_ for details).
39+
40+
.. code-block:: python
41+
42+
from requests.auth import HTTPBasicAuth
43+
from dicomweb_client.api import DICOMwebClient
44+
45+
client = DICOMwebClient(
46+
url="https://mydicomwebserver.com",
47+
auth=HTTPBasicAuth('myusername', 'mypassword')
48+
)
49+
50+
To simplify usage for ``HTTPBasicAuth``, you may also directly provide a username and password using the corresponding arguments.
3951

4052
.. code-block:: python
4153

0 commit comments

Comments
 (0)