simple_openid_connect.base_data#

Base data types which are extended with concrete OpenId data types in simple_openid_connect.data

Classes

OpenidBaseModel()

Base model type upon which all openid data types are built.

class simple_openid_connect.base_data.OpenidBaseModel#

Base model type upon which all openid data types are built.

It implements encoding and decoding functionality that are commonly used in OpenID contexts.

encode_url(url: str) str#

Encode this message as query string parameters into the existing url.

This method explicitly only encodes the message into an urls query string because Openid specifies that only responses can be returned via a fragment and since this library is only intended for usage as a relying party, it should never need to generate responses.

encode_x_www_form_urlencoded() str#

Encode this message as a x-www-form-urlencoded formatted string.

This is useful to send the message to an OP (if it is a request) either directly as GET url parameters or as an x-www-form-urlencoded request body

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

classmethod parse_jwt(value: str, signing_keys: List[JWK]) Self#

Parse received data that is encoded as a signed Json-Web-Signature (JWS).

Parameters:
  • value – The encoded JWT

  • signing_keys – List of keys one of which has been used to sign the JWT

classmethod parse_url(url: str, location: Literal['query', 'fragment', 'auto'] = 'auto') Self#

Parse a received message that is encoded as part of the URL as query parameters.

Parameters:
  • url – The url which contains a message either in its query string or fragment

  • location – Where the message data is located in the url. If set to ‘auto’, fragment will be tried first with query being used as a fallback.

classmethod parse_x_www_form_urlencoded(s: str) Self#

Parse a received message that is parsed from the given x-www-form-urlencoded formatted string.