With the Microsoft 365 integration, agents find their own Outlook contacts in the Web Agent. This page walks you through the setup in the order in which you carry it out: first at Microsoft, then in myContactCenter, then at each workstation. The last section describes how myContactCenter collects and sends emails in Exchange Online — for this, you set up a separate app registration with a client secret.
What the integration provides
Each agent connects their own Microsoft 365 account in the Web Agent. myContactCenter reads the contacts in the Outlook Contacts folder of that account and shows them to this agent in the phone book of the Softphone module. Other agents do not see them.
| What | With Microsoft 365 |
|---|---|
| The agent’s personal contacts (Contacts folder) | yes, in the Web Agent |
| Subfolders of the contacts folder, contacts shared by others | no |
| The organization’s global address list | no |
| Contacts in the installed Agent | no — it reads the local Outlook |
| Signing in to mailboxes and to the SMTP server | yes, without a user, with an app registration — see Email with Exchange Online |
Only contacts with at least one phone number go into the phone book.
Before you begin
- The Web Administration and the Web Agent are installed and reachable.
- You have an account in Microsoft Entra with at least the Cloud Application Administrator role. With it you create the app registration and grant consent for your organization.
- Every agent who should see their contacts has their own Microsoft 365 account with a mailbox in Exchange Online.
- The server on which the Web Agent runs reaches
login.microsoftonline.comandgraph.microsoft.comover HTTPS (port443). The connections to Microsoft are made by the server, not by the agent’s browser.
Keep a text editor at hand: you copy two long identifiers from step 1 into step 5.
Step 1: Register the application in Microsoft Entra
-
Open
https://entra.microsoft.comand sign in with the account from the prerequisites. -
Open App registrations: in the menu on the left under Entra ID, in older views under Identity › Applications.
-
Click New registration.
-
Under Name, enter a name by which you will recognize the application later, such as
myContactCenter. -
Under Supported account types, select Accounts in this organizational directory only (single tenant).
-
Leave Redirect URI empty; sign-in with a code does not need one.
-
Click Register. Entra opens the Overview of the new application.
-
Copy two values from there into your text editor — the icon next to a value copies it:
- Application (client) ID
- Directory (tenant) ID
Both look like
1a2b3c4d-1234-5678-9abc-def012345678.
For the contacts, the application needs neither a client secret nor a certificate.
Step 2: Allow sign-in with a code
Agents in the Web Agent and administrators on the Microsoft 365 settings tab sign in with a code. Entra only allows this if it is enabled for the application.
- In the application, open Authentication.
- Under Advanced settings, set Allow public client flows to Yes. In the newer view, the switch is on the Settings tab.
- Click Save.
Without this setting, every sign-in with a code fails — the agents’ as well as the one in the Administration.
Step 3: Add permissions and grant consent
-
In the application, open API permissions.
-
Click Add a permission, then Microsoft Graph and Delegated permissions.
-
Tick these permissions; the search field finds them by name:
Permission Purpose Contacts.Readread the contacts of the signed-in agent User.Readread the name of the signed-in account; usually already listed offline_accesskeep the sign-in so that the agent does not have to sign in again and again openid,profilethe sign-in itself; in the OpenId permissions group -
Click Add permissions.
-
Click Grant admin consent for … and confirm with Yes. The Status column then shows Granted for … for each permission.
Without this consent, Microsoft asks each agent at their first sign-in; if users in your organization may not consent to applications, the sign-in fails. This application does not need application permissions: myContactCenter reads the contacts only with the account of the respective agent and only that agent’s own contacts. Application permissions are only needed by the app registration for emails.
Step 4: Check Conditional Access policies
Many organizations block sign-in with a code through a Conditional Access policy: under Authentication flows, the policy selects and blocks the Device code flow. The agents’ sign-in and the check in the Administration then fail.
- In Entra, open Conditional Access › Policies.
- Check every active policy that uses Authentication flows under Conditions.
- If one of them blocks the Device code flow, exclude the agents — most easily through a group under Users › Exclude. Agree this with the person responsible for your organization’s security.
Policies that require multifactor authentication do not get in the way: the agent confirms it during sign-in on the Microsoft page. Policies that require a compliant or Entra-joined device, on the other hand, cannot be satisfied by sign-in with a code.
Step 5: Set up myContactCenter
You enter the values in the server configuration — in the Web Administration or in the installed Administration. The steps describe the Web Administration; the differences in the installed Administration are described below.
-
In the Web Administration, open Configuration under Servers on the Settings tab and there the Microsoft 365 settings tab.
-
Under Entra/Azure AD application, enter the values from step 1:
Field Value from Entra Directory ID (mandant) Directory (tenant) ID Application ID (Client) Application (client) ID Make sure there are no spaces before or after the values, and do not mix the two up.
-
Under Utilization, switch on Use Microsoft 365 address book. This is the same switch as Use Exchange/Microsoft 365 address book on the Address books tab.
-
Leave Use Microsoft 365 mail account switched off. myContactCenter does not evaluate this option; how emails work is described under Email with Exchange Online.
-
Click Save.
If one of the two identifiers is missing while the switch is on, the Web Administration asks before saving: The following functions are not configured with Microsoft 365.
The setting takes effect immediately: agents who are signed in can connect their account without signing in again.
From this tab, the server only stores the application — tenant, client and the two switches —, no account and no sign-in. It stores the agents’ sign-ins separately for each agent, see Step 6.
In the installed Administration
You open the server configuration with Configuration in the Servers group of the ribbon. There, the values are spread over two tabs:
| What | Where |
|---|---|
| Directory ID (mandant), Application ID (Client) | Microsoft 365 settings tab |
| Switch for the address book | Address books tab: Use Exchange/Microsoft 365 address book |
| Use Microsoft 365 mail account | missing; the option is not evaluated anyway |
If the switch for the address book is on and an identifier is missing, the Administration reports Settings incomplete with Microsoft 365 when saving and switches to the Microsoft 365 settings tab.
The other fields of the tab — the account, Connect, Test and Access token — serve to check the app registration. You do not need them for the agents’ contacts.
Checking the app registration
With Connect and Test on the Microsoft 365 settings tab, you check the tenant, the client and the settings in Entra before the agents sign in. To do so, you sign in any Microsoft 365 account of your organisation, for example your own — with the same sign-in with a code as the agents in the Web Agent.
The sign-in only applies to the current session of the Administration. The
server does not store it, not even with Save; from this tab it keeps only
the app registration. The values currently in the fields are checked, so you
can check before saving. The connections to login.microsoftonline.com and
graph.microsoft.com are made by the server of the Web Administration, or by
the computer of the installed Administration.
- Enter Directory ID (mandant) and Application ID (Client) and click Connect. As long as one of the two values is missing, the button is locked.
- The Administration shows a code and the address of the Microsoft sign-in page. Open the page with Open sign-in page or in any browser, also on another computer, enter the code and sign in. The code is only valid for a few minutes.
- Until the code has been entered, the Administration shows Waiting for the code to be entered at Microsoft. It then connects by itself and reports Login successful. The account appears on the tab, and Connect becomes Disconnect.
- Click Test. The Administration reads the contacts in the Contacts folder of the signed-in account through Microsoft Graph and reports Addressbook test for with the account and the Entry count, or with the Error. All contacts are counted, including those without a phone number.
Disconnect signs the account out again; the Administration reports Logoff success.
How the code appears differs:
- Web Administration: The code, the note and the Open sign-in page link are on the tab itself; the page opens in a new tab. Cancel next to them ends the pending sign-in; clicking Connect again requests a new code. The result appears next to the buttons, preceded by Successful or Failed; during the test it shows Settings are checked. Test reads the contacts again with every click. If you change the tenant or the client after signing in, the sign-in no longer counts: Microsoft365 Account shows (not connected) again. Only main administrators can use Connect and Test; after the sign-in at Microsoft, the Web Administration checks the right once more and discards the sign-in if it is missing.
- Installed Administration: A dialog shows the code and the note, together with Open sign-in page for the default browser, Copy code for the clipboard and Cancel. After the sign-in it closes by itself. The result appears below the buttons of the tab. Test shows the contacts that the Administration read after the sign-in. Next to Access token, Valid days shows how many days the sign-in has left.
| Message or observation | Cause | Remedy |
|---|---|---|
| The sign-in was not completed in time. | The code was not entered in time. | Connect again |
Login not successful with the reason from Microsoft, usually a code AADSTS… |
An identifier is wrong, public client flows are not allowed, the device code flow is blocked, or the sign-in was declined on the Microsoft page. | Step 1, Step 2, Step 4 |
In the Web Administration, Test reports an Error with invalid_grant or interaction_required. |
Microsoft requires a new sign-in, for example after a password change. The account is then signed out. | Connect again |
| Connect or Test is locked. | The tenant or the client is missing, no account is signed in yet for Test, or you are not a main administrator in the Web Administration. | Enter the values and Connect; in the Web Administration, sign in as a main administrator |
Step 6: Agents connect their account
Each agent connects their account once in the Web Agent:
- On the Settings tab, open Special settings and, in the Microsoft 365 section, click Connect Microsoft 365.
- The Web Agent shows a code. Open Microsoft sign-in opens Microsoft’s sign-in page in a new tab; enter the code there, sign in with their own Microsoft 365 account and confirm the access. The code is valid for a few minutes only.
- Back in the Web Agent, the account and the number of Contacts are shown.
The server stores the sign-in separately for each agent; it applies at every workstation where the agent logs in to the Web Agent. The Web Agent reads the contacts again at every login and every 30 minutes and renews the sign-in at Microsoft in the process, so the connection is usually needed only once. Only if Microsoft rejects the sign-in, for example after a password change, does the agent have to sign in again with Sign in again. The description for agents is under Special settings.
In the Administration’s agent dialog, the Microsoft365 Account field shows the connected account. As long as an agent is connected, it cannot be changed there.
Checking
Check the setup with an agent account that has contacts with phone numbers in Outlook:
- The Microsoft 365 section in the special settings shows the account and a number greater than zero for Contacts.
- In the Softphone module, type part of a contact’s name: the phone book shows the contact with its numbers.
- Create a new contact with a phone number in Outlook and click Refresh contacts in the Web Agent: the contact appears.
If it does not work
Messages on the Microsoft 365 settings tab of the Administration are listed under Checking the app registration.
| Message or observation in the Web Agent | Cause | Remedy |
|---|---|---|
| Microsoft 365 contacts are not enabled for this session. | The switch is off, or an identifier is missing. | Step 5 |
| Microsoft 365 connection failed. Sign in again or check the app's public-client and tenant policies. | Public client flows are not allowed, an identifier is wrong, the device code flow is blocked, or Microsoft requires a new sign-in, for example after a password change. | Step 2, Step 4, Step 5, then Sign in again |
| Microsoft 365 sign-in was canceled or expired. | The code was not entered in time, or the agent canceled. | Connect Microsoft 365 again |
| Microsoft’s page asks for an administrator’s approval. | Consent is missing. | Step 3, item 5 |
| The account is connected, but there are zero Contacts. | The contacts are in a subfolder, in the global address list or in someone else’s mailbox. | Put the contacts in the Contacts folder of the agent’s own mailbox |
| A contact is missing from the phone book. | It has no phone number. | Add a number in Outlook |
| The installed Agent shows no Microsoft 365 contacts. | It only reads the local Outlook. | Address books |
Email with Exchange Online
Exchange Online now only allows collecting via IMAP with OAuth, and Microsoft is switching off sign-in with user name and password at the SMTP server. myContactCenter therefore signs in to Exchange Online with OAuth — when collecting the mailboxes as well as when sending.
The sign-in takes place without a user: the Routing Service uses the tenant, client and client secret of an app registration to obtain an access token from Microsoft and uses it to sign in as the mailbox. Nobody has to sign in interactively for this, and the Routing Service renews the token itself before it expires. The app registration for the contacts from the steps above is not sufficient for this: it has no client secret and no application permissions.
For this, the computer with the Routing Service must reach:
| Destination | Port | Purpose |
|---|---|---|
login.microsoftonline.com |
443 (HTTPS) |
obtaining access tokens |
outlook.office365.com |
993 |
collecting mailboxes (IMAP) |
smtp.office365.com |
587 |
sending emails (SMTP) |
Automatic reports by email are sent by the server; with OAuth, it then also
needs the connections to login.microsoftonline.com and smtp.office365.com.
The app registration for emails
A separate application keeps the far-reaching application permissions apart from the agents’ sign-in. For the following, you need at least the Cloud Application Administrator role in Entra and the rights of an Exchange administrator in Exchange Online.
-
In Entra, under App registrations, create an application with New registration as described in Step 1, for example with the name
myContactCenter Email. Copy the Application (client) ID and the Directory (tenant) ID. -
In the application, open Certificates & secrets and click New client secret. Enter a description, select the validity period and click Add.
-
Immediately copy the Value of the secret — not the Secret ID. Entra shows the value only this once. Note the expiry date.
-
Open API permissions, click Add a permission, select APIs my organization uses and there Office 365 Exchange Online, then Application permissions. Tick:
Permission Purpose IMAP.AccessAsAppcollecting mailboxes SMTP.SendAsAppsending emails If you only need one of the two, the matching permission is sufficient.
-
Click Add permissions and then Grant admin consent for ….
-
In Entra, open Enterprise applications, search for the application and copy the Object ID from its Overview. This is a different identifier from the object ID under App registrations.
Application permissions alone do not open a mailbox yet. Exchange Online must
know the application as a service principal and grant it access to every
mailbox as which myContactCenter signs in. You do this in PowerShell with the
ExchangeOnlineManagement module:
Connect-ExchangeOnline
New-ServicePrincipal -AppId <Application-ID> -ObjectId <Object-ID> -DisplayName "myContactCenter Email"
Add-MailboxPermission -Identity service@contoso.com -User <Object-ID> -AccessRights FullAccess
You need New-ServicePrincipal once per application, and
Add-MailboxPermission for every mailbox that myContactCenter collects or
with which it signs in for sending.
In myContactCenter, you enter the three values — for sending in the server configuration, for collecting in each mailbox:
| Field in myContactCenter | Value from Entra |
|---|---|
| Directory ID (mandant) | Directory (tenant) ID |
| Application ID (Client) | Application (client) ID |
| Client secret | the Value of the secret |
myContactCenter stores the secret encrypted. If it expires, every sign-in fails. Create a new one in good time and enter it everywhere the old one is used.
Sending emails
You configure sending in the server configuration on the Email send configuration tab, see Email sending. With Exchange Online, there are three ways; for new systems, sign-in with OAuth is the right one.
Sign-in with Microsoft 365 (OAuth)
myContactCenter signs in to Microsoft’s SMTP server as a mailbox with the app registration for emails.
| Field | Value |
|---|---|
| SMTP server | smtp.office365.com |
| Port | 587 |
| User name | the mailbox as which myContactCenter signs in, such as service@contoso.com. If empty, it signs in as the Sender mailbox. |
| Password | empty; it is not used with OAuth |
| Sign in with Microsoft 365 (OAuth) | switched on |
| Directory ID (mandant), Application ID (Client), Client secret | the values of the app registration |
| Sender mailbox | the same address or one for which the mailbox has the Send As permission |
At Microsoft, this requires:
- The mailbox as which myContactCenter signs in has been granted to the
application with
Add-MailboxPermission. - Authenticated SMTP is switched on for this mailbox: in the Microsoft 365 admin center under Users › Active users, the account, Mail tab, Manage email apps. Confirm with Save changes.
Skills and automatic reports with their own sender use the same sign-in. If User name is empty, myContactCenter signs in as their sender address in each case — then each of these addresses needs the access grant and Authenticated SMTP. If a User name is entered, this mailbox needs the Send As permission for the senders.
Check sending with Test. If the sign-in at Microsoft fails, Test
reports Failed with the reason; if the app registration is rejected, with a
code such as AADSTS7000215.
Differences between the Administrations:
| Installed Administration | Web Administration |
|---|---|
| The fields are next to the SMTP server. With Sign in with Microsoft 365 (OAuth) switched on, Password is locked; switched off, the three fields of the app registration are locked. If a value is missing while the switch is on, the Administration highlights the field in colour. | The fields are in the Microsoft 365 (Entra/Azure AD app) group and always remain editable; a Password remains unused with OAuth. Client secret does not show a saved secret but (leave unchanged); left empty, it is kept. It can only be removed with Clear, and only by main administrators. |
If a value of the app registration is missing while the switch is on, sending counts as not set up: when saving, the Administration asks with The following functions are not configured and Mailing (Email configuration).
Relay through a connector
Exchange Online accepts emails from the server without a sign-in because it
recognizes the server by its fixed IP address. This requires a fixed public
IPv4 address through which the Routing Service reaches the internet, and
outbound port 25 being open — some internet providers block it.
At Microsoft:
- Open
https://admin.exchange.microsoft.comand there Mail flow › Connectors. - Click Add a connector.
- Select Your organization's email server as the source and Office 365 as the destination.
- Enter a name, such as
myContactCenter. - Choose identification by the IP address of the sending server and enter the fixed public IP address.
- Finish the wizard with Create connector.
- Add
ip4:and this address to your domain’s SPF record in DNS. Otherwise recipients outside your organization easily take the emails for spam. - Look up the target of your MX record: in the Microsoft 365 admin center under
Settings › Domains, your domain, DNS records. It has the form
contoso-com.mail.protection.outlook.com.
In myContactCenter:
| Field | Value |
|---|---|
| SMTP server | the target of the MX record, such as contoso-com.mail.protection.outlook.com |
| Port | 25 |
| User name, Password | empty |
| Sign in with Microsoft 365 (OAuth) | switched off |
| Sender mailbox | an address of your domain, such as service@contoso.com |
In the Web Administration, you remove a password that has already been saved with Clear next to the field; a field left empty keeps it. Check sending with Test.
Sign-in with mailbox and password
myContactCenter signs in to Microsoft’s SMTP server with the user name and password of a mailbox.
| Field | Value |
|---|---|
| SMTP server | smtp.office365.com |
| Port | 587 |
| User name | the full address of a licensed mailbox, such as service@contoso.com |
| Password | the password of this mailbox |
| Sign in with Microsoft 365 (OAuth) | switched off |
| Sender mailbox | the same address or one for which the mailbox has the Send As permission |
For Microsoft to accept the sign-in:
- Switch on Authenticated SMTP for the mailbox as described under Sign-in with Microsoft 365 (OAuth).
- The account must not require multifactor authentication.
- If the Security defaults are switched on in Entra or a policy blocks legacy authentication, Microsoft does not accept the sign-in.
If the sign-in fails, Test reports Failed with Microsoft’s reason, such
as 5.7.139.
Collecting emails
myContactCenter collects a mailbox in Exchange Online with the
app registration for emails. For this, the application needs
IMAP.AccessAsApp, and the mailbox must have been granted to it with
Add-MailboxPermission. The mailbox does not need a password.
In the mailbox, enter:
| Field | Value |
|---|---|
| Mail address | the address of the mailbox, such as service@contoso.com |
| Server | outlook.office365.com |
| Port | 993 |
| Account name | the mailbox as which myContactCenter signs in. If empty, it signs in as the Mail address. |
| Password | empty; with OAuth, the field is locked |
| Directory ID (mandant), Application ID (Client), Client secret | the values of the app registration |
Where the OAuth fields are located differs:
- Installed Administration: On the Microsoft 365 tab, switch on the Sign in with Microsoft 365 (OAuth) option; only then can the three fields be edited.
- Web Administration: On the Mailbox tab, under Authentication type, select Microsoft 365 (OAuth) instead of User name and password. Below it, the Microsoft 365 (Entra/Azure AD app) group appears with the three fields and a note on the required permissions. Client secret shows •••••• (leave empty = unchanged). Microsoft365 Account and State only show whether the details have been saved completely: Connected / valid does not mean that the sign-in works.
A Client secret left empty keeps the one already saved when saving, as long as the tenant and client stay the same. Check the sign-in with Test connection: Is authenticated shows whether it worked; if it fails, the reason is shown below. Status of services shows the same reason for the mailbox.
If emails do not work
| Observation | Cause | Remedy |
|---|---|---|
The reason mentions AADSTS7000215 or another AADSTS… code. |
Microsoft rejects the app registration: secret wrong or expired, tenant or client wrong. | Check the values; create a new secret if necessary — App registration for emails |
| The reason mentions an incomplete app registration. | Tenant, client or secret is missing. | Fill in all three fields |
The reason mentions login.microsoftonline.com as unreachable. |
The Routing Service does not reach Microsoft. | Check the firewall and proxy for port 443 |
Test connection: the connection is established, the sign-in fails without an AADSTS… code. |
The application does not have IMAP.AccessAsApp, consent is missing, or the mailbox has not been granted. |
Check the permission and consent, run New-ServicePrincipal and Add-MailboxPermission |
Test for sending reports Failed without an AADSTS… code. |
SMTP.SendAsApp is missing, the mailbox has not been granted, Authenticated SMTP is off, or the mailbox lacks Send As for the sender. |
Sign-in with Microsoft 365 (OAuth) |
| Mailbox not saved | An agent uses the same Microsoft 365 account for their contacts. | Use a separate account for the mailbox |
A running Routing Service only applies changes to a mailbox — including a new secret — after it has been restarted, see Changing and deleting.