Skip to content

Auth

Creds

A class to store and handle login credentials.

Parameters:

Name Type Description Example
homeserver str Url to homeserver https://matrix.org
username str Bot username mybot
password str Bot password password123
login_token str Login token. Can be used instead of password asdfAWvZQweVHNt123...
access_token str Access token. Can be used instead of password asdfAWvZQweVHNt123...
session_stored_file str Location to read and write session data session.txt

from_json static

Creds.from_json(filepath: str) -> Creds

Make credits object from .json file.

session_read_file

session_read_file() -> None

Reads and decrypts the device_id and access_token from file.

session_write_file

session_write_file() -> None

Encrypts and writes to file the device_id and access_token.