My problem is similar to yours. I have contracted Microsoft365 for the administration and management of our company's emails. Something curious happens to me with two email accounts in only 2 of the 8 Apple devices we have in the company. The rest of the devices have Linux, Windows and Android operating systems. The 2 devices in question have the following infrastructure:
iPhone Xr, iOS 18.3.2 version.
iPhone 13, iOS 18.3.1 version.
When trying to authenticate with the username and password on each of these devices, both for the Outlook app and the Teams app, we get the following error: “AADST50020: User account from identity provider does not exist in tenant ‘domain.com’ and cannot access the application (Outlook Mobile / Teams Mobile) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account.”
The users exist, are active and have all the appropriate permissions just like the rest of the 16 accounts we have contracted.
Does anyone know how to fix this issue. Microsoft replied that because Apple is a third party, their support is limited and they cannot help me.