lories.application.view.login.authentication#

Exceptions#

AuthenticationException

Raise if an error occurred authenticating a session or user.

Classes#

Authentication

Helper class that provides a standard way to create an ABC using

Functions#

get_random_string(length[, allowed_chars])

Return a securely generated random string.

Module Contents#

exception lories.application.view.login.authentication.AuthenticationException(reason: str)#

Bases: lories.application.interface.InterfaceException

Inheritance diagram of lories.application.view.login.authentication.AuthenticationException

Raise if an error occurred authenticating a session or user.

Initialize self. See help(type(self)) for accurate signature.

class lories.application.view.login.authentication.Authentication(app: dash.Dash, configs: lories.core.Configurations, login_route: str = 'auth', public_routes: list | None = None, secret_key: str = None)#

Bases: lories.core.Configurator, dash_auth.auth.Auth

Inheritance diagram of lories.application.view.login.authentication.Authentication

Helper class that provides a standard way to create an ABC using inheritance.

lories.application.view.login.authentication.get_random_string(length, allowed_chars=RANDOM_STRING_CHARS)#

Return a securely generated random string.

The bit length of the returned value can be calculated with the formula:

log_2(len(allowed_chars)^length)

For example, with default allowed_chars (26+26+10), this gives:
  • length: 12, bit length =~ 71 bits

  • length: 22, bit length =~ 131 bits