Skip to content

Commit

Permalink
Add documentation on usage of auth parameter (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntenenz authored Apr 4, 2019
1 parent 1b18dc4 commit fc7e5e6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://docs.python-requests.org/en/master/user/authentication/>`_ 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
Expand Down

0 comments on commit fc7e5e6

Please sign in to comment.