Skip to content

taipy.auth.config.AuthenticationConfig

Bases: UniqueSection

Configuration for default authentication.

Attributes:

Name Type Description
protocol str

The name of the protocol to configure ("ldap", "taipy" or "none").

secret_key Optional[str]

A secret string used to internally encrypt the credentials' information. If no value is provided, the first run-time authentication sets the default value to a random text string.

auth_session_duration Optional[int]

How long, in seconds, are credentials valid after their creation. The default value is 3600, corresponding to an hour.

**properties dict[str, Any]

Additional arguments that depend on the indicated protocol.
Depending on the protocol, these arguments are:

- "LDAP" protocol: the following arguments are accepted:
    - *server*: the URL of the LDAP server this authenticator connects to.
    - *base_dn*: the LDAP distinguished name that is used.
- "Taipy" protocol: the following arguments are accepted:
    - *roles*: a dictionary that configures the association of usernames to
       roles.
    - *passwords*: if required, a dictionary that configures the association of
       usernames to hashed passwords.
    A user can be authenticated if it appears at least in one of the *roles*
    or the *password* dictionaries.<br/>
    If it only appears in *roles*, then the user is authenticated if provided
    a password exactly identical to its username.<br/>
    If it only appears in *passwords*, then the user is assigned no roles.
- "None": No additional arguments are required.