pylithium.client

class pylithium.client.LithiumClient(client_id, client_domain, secret_key, settings=None)[source]

Client object used to create a lithium SSO token.

classmethod decode(secret_key, encoded)[source]

Uses CBC mode on AES encryption to decrypt a string with the key and initialization vector.

Parameters:
  • secret_key – The key used, presumably, to encode the data.
  • encoded – Encoded data.
Returns:

The decoded string value.

classmethod encode(secret_key, unencoded)[source]

Uses CBC mode with an AES encryption encrypt a string.

Parameters:
  • secret_key – The secret key to encode with.
  • unencoded – Plain-text data to encode.
Returns:

The encoded value in a style used by Lithium for SSO interpretation.

Formats and returns the cookie name and encrypted cookie.

Parameters:
  • uid – unique id for a user.
  • username – the username.
  • email – email address of the user.
  • user_agent – User-Agent header value.
  • referer – Referer header.
  • remote_addr – Remote address of client.
  • server_id – The id of the server issuing this token.
Returns:

A cookie name and value tuple for Lithium SSO.

Previous topic

Welcome to pylithiumsso’s documentation!

This Page