Hi,
You may use: user@mathieu.company .com\shared OR user@mathieu.company .onmicrosoft.com\shared & enter the password of the main user. As of October 1st, 2022, basic authentication (username and password) does not work when trying to connect to Microsoft accounts. You need to create an App Specific password when connecting to an account via IMAP
how to create an app pwd: https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9
But keep in mind:
A shared mailbox is not intended for direct access. The user account for the shared mailbox should remain Disabled (or "disconnected").
While it is technically possible, especially for applications, you must license the mailbox or use a separately licensed mailbox for shared mailbox access.
A license is required for any user object (in this case, the user account representing the shared mailbox) that uses its own password to access a cloud resource (in this case, its own mailbox) via any protocol.
If you use AAD Connect to synchronize the shared mailbox object, you must enable the user object in the local Active Directory, set a password, synchronize the object, and assign a license.
Assign a license and set the password if the shared mailbox object is a cloud-only object.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".