You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage.rst
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,10 @@ You can specify these prefixes using ``qido_url_prefix``, ``wado_url_prefix``, a
34
34
stow_url_prefix="stowrs"
35
35
)
36
36
37
+
.. _auth:
38
+
39
+
Authentication and authorization
40
+
++++++++++++++++++++++++++++++++
37
41
38
42
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
43
@@ -43,15 +47,15 @@ To interact with servers requiring authentication, ``DICOMwebClient`` accepts ar
43
47
from dicomweb_client.api import DICOMwebClient
44
48
from dicomweb_client.session_utils import create_session_from_auth
45
49
46
-
auth=HTTPBasicAuth('myusername', 'mypassword')
50
+
auth=HTTPBasicAuth('myusername', 'mypassword')
47
51
session = create_session_from_auth(auth)
48
52
49
53
client = DICOMwebClient(
50
54
url="https://mydicomwebserver.com",
51
55
session=session
52
56
)
53
57
54
-
To simplify usage for ``HTTPBasicAuth``, you may also directly provide a username and password using the corresponding arguments.
58
+
To simplify usage for basic HTTP authentication, you may also directly provide a username and password using the corresponding arguments.
55
59
56
60
.. code-block:: python
57
61
@@ -101,7 +105,7 @@ To interact with servers requiring certificate-based authentication, you can pro
To interact with a server of the Google Healthcare API requiring OpenID Connect based authentication and authorization provide a session authenticated using the Google Cloud Platform (GCP) credentials.
108
+
To interact with a server of the Google Healthcare API requiring OpenID Connect based authentication and authorization, provide a session authenticated using the Google Cloud Platform (GCP) credentials.
105
109
See `GCP documentation <https://cloud.google.com/docs/authentication/production>`_ for details.
106
110
107
111
Note that GCP authentication requires installation of the package distribution with the ``gcp`` extra requirements: ``$ pip install dicomweb-client[gcp]``.
0 commit comments