Settings

Settings for oic objects.

Caution

This part is under development. Most of the configuration options are being converted from keyword arguments to settings class. Using the settings class is optional for now, but will become a necessity later on.

In order to configure some objects in PyOIDC, you need a settings object. If you need to add some settings, make sure that you settings class inherits from the appropriate class in this module.

exception oic.utils.settings.SettingsException

Bases: Exception

Exception raised by misconfigured settings class.

class oic.utils.settings.PyoidcSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5)

Bases: object

Main class for all settings shared among consumer and client.

Keyword Arguments:
 
  • verify_ssl – Control TLS server certificate validation. If set to True the certificate is validated against the global settings, if set to False, no validation is performed. If set to a filename this is used as a certificate bundle in openssl format. If set to a directory name this is used as a CA directory in the openssl format.
  • client_cert – Local cert to use as client side certificate. Can be a single file (containing the private key and the certificate) or a tuple of both file’s path.
  • timeout – Timeout for requests library. Can be specified either as a single float or as a tuple of floats. For more details, refer to requests documentation.
class oic.utils.settings.ClientSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5, requests_session: requests.sessions.Session = None)

Bases: oic.utils.settings.PyoidcSettings

Base settings for consumer shared among OAuth 2.0 and OpenID Connect.

Keyword Arguments:
 requests_session – Instance of requests.Session with configuration options.
class oic.utils.settings.OauthClientSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5, requests_session: requests.sessions.Session = None)

Bases: oic.utils.settings.ClientSettings

Specific settings for OAuth 2.0 consumer.

class oic.utils.settings.OicClientSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5, requests_session: requests.sessions.Session = None)

Bases: oic.utils.settings.OauthClientSettings

Settings for OpenID Connect Client.

class oic.utils.settings.OauthConsumerSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5, requests_session: requests.sessions.Session = None)

Bases: oic.utils.settings.OauthClientSettings

Settings for OAuth 2.0 client.

class oic.utils.settings.ServerSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5)

Bases: oic.utils.settings.PyoidcSettings

Base settings for server shared among OAuth 2.0 and OpenID Connect.

class oic.utils.settings.OauthServerSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5)

Bases: oic.utils.settings.ServerSettings

Specific settings for OAuth 2.0 server.

class oic.utils.settings.OicServerSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5)

Bases: oic.utils.settings.OauthServerSettings

Specific settings for OpenID Connect server.

class oic.utils.settings.OauthProviderSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5)

Bases: oic.utils.settings.OauthServerSettings

Specific settings for OAuth 2.0 provider.

class oic.utils.settings.OicProviderSettings(verify_ssl: Union[bool, str] = True, client_cert: Union[str, Tuple[str, str]] = None, timeout: Union[float, Tuple[float, float]] = 5)

Bases: oic.utils.settings.OicServerSettings

Specific settings for OpenID Connect provider.