Unable to accept invite token


I have a Matomo platform with the ldap plugin working, which forces me to disable the login plugin. When I create a new user on the platform, matomo sends a token by email, but when the new user follows the link, an error appears that the login plugin is not active, which means that the user cannot accept the invitation and the account expires at the end of the default seven days.
Matomo Version 4.14.1
mysql Ver 14.14 Distrib 5.7.41
PHP 8.0.26
Ubuntu 18.04.6 LTS

Edit: Doesn’t even send the email with the invitation. When I copy the link in the admin page I get the error described above.