Setting it up
1
Register an app
In the Microsoft Entra admin center, App registrations →
New registration. For supported account types pick Accounts in any organizational
directory and personal Microsoft accounts, so a work mailbox and an Outlook.com mailbox
can both connect.
2
Add the redirect URI
Authentication → Add a platform → Web, with the redirect URI that Admin →
Configuration → Accounts shows you, character for character. It is
https://your-instance/api/auth/microsoft/callback, built from Public URL — fix
that setting first if it looks wrong. A mismatch is the whole of AADSTS50011.3
Add the permissions
API permissions → Add a permission → Microsoft Graph → Delegated:
Mail.Read,
Calendars.Read, User.Read and offline_access. None of these needs admin consent,
and none can send, move or delete anything.4
Create a secret and paste both in
Certificates & secrets → New client secret. Copy its value — it is shown once —
and paste it with the Application (client) ID into Admin → Configuration → Accounts.
Entra secrets expire, two years at most; note the date somewhere you will see it.
admin_get_microsoft_config, admin_set_microsoft_config.