The Login action is a System Action that logs a specified end-user in the system. The last login information is updated. All persistent roles are loaded with the respective grant or revoke. As an alternative, the User_Login action from the Users eSpace can be used.
The Login action clears all Session Variables to their default values when a different end-user logs in.
UserId: identifier of the end-user.
Identifier Type. Mandatory.
Persistent: boolean value that indicates whether the login information remains after a session time-out. When this end-user accesses again, using the same device, OutSystems Platform automatically logs him/her in on the application. See Authenticating End-users.
Boolean Type. Mandatory.
An invalid login exception might be raised when, for example, the end-user does not exist or it is not active.
When developing Multi-tenant applications you need to ensure that the session is bound to the correct tenant. Since the Login action runs in the scope of the current tenant, if the user does not exist in that tenant, the Login action fails.
To ensure the correct login process is performed, you need to:
Design the business logic to obtain the tenant for the end-user;
Use the TenantSwitch System action to bind the session to the obtained tenant;
Use the Login action.
As an alternative you can use the User_Login action from the Users eSpace. This action automatically binds the session to the correct tenant. To use this action, you just need to ensure that end-users have unique names across all tenants.
Authenticating Users | Overview of System Actions and Functions