Skip to content

AuthenticationConfig class

Bases: Section

Configuration for an authentication protocol.

Attributes:

Name Type Description
id str

Unique identifier of the authentication config. It must be a valid Python variable name.

protocol str

The name of the protocol to configure ("ldap", "entra_id", "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.
  • "Entra ID" protocol: the following arguments are required:
    • client_id: the client ID of the Entra ID application. The application must be registered in the Azure Entra ID portal and have the required permissions including the "User.Read" and "Team.ReadBasic.All" permissions.
    • tenant_id: the tenant ID of the Entra ID organization.
  • "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.
      If it only appears in roles, then the user is authenticated if provided a password exactly identical to its username.
      If it only appears in passwords, then the user is assigned no roles.
      If it does not appear in roles or passwords, then the user cannot be authenticated.
  • "None": No additional arguments are required.

Attributes

id instance-attribute

id: str = _validate_id(id)

A valid python identifier that uniquely identifies the section.

properties property writable

properties

A dictionary of additional properties.