dicomweb-client
dicomweb-client copied to clipboard
Add session utils for authentication and authorization using OpenID Connect (OIDC)
This PR implements utilities to create authorized requests.Session
objects using OpenID Connect (OIDC).
It introduces two public classes that are both derived from requests.Session
:
-
ConfidentialClientSession
for confidential clients using the OAuth 2.0 Client Credentials grant type -
PublicClientSession
for public clients using the OAuth 2.0 Authorization Code grant type with Proof Key for Code Exchange (PKCE) challenge
It further adds the utility function create_session_from_client_credentials()
that facilitates the creation of instances of the above classes given corresponding client credentials (ConfidentialClientCredentials
or PublicClientCredentials
).