comotion.auth module

class comotion.auth.Auth(orgname, issuer='https://auth.comotion.us', credentials_cache_class=<class 'comotion.auth.KeyringCredentialCache'>)[source]

Class that authenticates the user, caches credentials

authenticate()[source]
get_access_token()[source]
class comotion.auth.CredentialsCacheInterface(issuer, orgname)[source]

Interfaced to be implemented in concrete class that executes caching of credentials for users

get_current_user()[source]

Get latest authenticated user for the issuer and orgname

Returns: str: preferred_username

get_offline_token()[source]

Get offline token for the current user from cache

set_offline_token(username, token)[source]

Set offline token for current user and update current user

class comotion.auth.KeyringCredentialCache(issuer, orgname)[source]

Credential cache using the python keyring class. Saves to local keyring available on linux, windows and macosx

get_current_user()[source]

Get latest authenticated user for the issuer and orgname

Returns: str: preferred_username

get_refresh_token()[source]
set_refresh_token(username, token)[source]
class comotion.auth.OIDCServer(como_authenticator, pkce)[source]
class comotion.auth.OIDCredirectHandler(request, client_address, server)[source]
do_GET()[source]
log_message(format, *args)[source]

Overrider log_message to prevent from logging of requests

setup()[source]
class comotion.auth.PKCE(code_challenge, code_verifier)[source]
PKCE_CODE_VERIFIER_MAX_LENGTH = 40
static generate_pkce()[source]
get_code_challenge()[source]
get_code_verifier()[source]