Connect Microsoft 365 Mail Account with Entra ID - endless admin approval loop

Hello together,

I’m trying since a few days to connect Microsoft 365 Email Accounts with Nextcloud. Enterprise App is successful installed in Entra ID, Nextcloud configuration according to the documentation set. If I try to connect the mail account, Microsoft pop-up opens. After that immediately the information “Pop-up login window closed” is shown in the Nextcloud interface (not pop-up). After putting my password in the Microsoft approval pop-up the feedback comes up, that an admin has to approve the access. After approving by an admin the information "You can close the window” comes up. After closing, nothing happens. No integrated email account.

If I start the mail integration again in Nextcloud exactly the same process starts again.

Any idea how to solve this?

Philipp

In addition: I found this in the log files:

ClientExceptionAccount 97 does not exist or you don\'t have permission to access it

In Entra ID, all API permissions are enabled, and administrator consent is set to NO.

Enterprise Apps > Permissions:

Admin Consent:

  • IMPA.AccessAsUsers.All
  • offline_access
  • openid
  • SMTP.Send
  • Use.Read