login() function

Log in.

Available in Taipy Enterprise only

This function exists only in the Enterprise edition of Taipy.

This function creates Credentials using the protocols from the authenticators. Note that if no authenticator is created, the configured authenticators are created, as described in Authenticator.get_authenticators().

If the username and password are not provided, the function will attempt to authenticate the user using the Entra ID protocol if configured.

Parameters:

Name Type Description Default
username Optional[str]

The name of the user that needs to be authenticated.

None
password Optional[str]

The expected password for that user.

None

Returns:

Name Type Description
Credentials Credentials

A valid Credentials instance.

Raises:

Type Description
InvalidCredentials

The username and password combination does not correspond to an authenticated user.

ValueError

The configuration for authentication is invalid.