Configuring OAuth 2.0 for Exchange Online (Office 365)
Before you begin, make sure that your Office 365 administrator account has a mailbox configured in Exchange Online.
Step 1: Add ApplicationImpersonation role in Exchange Online
-
Sign in to the Exchange admin center in Office 365.
-
Add the ApplicationImpersonation role to your Office 365 administrator account:
-
Go to Roles | Admin roles.
-
Select Add role group and fill in the basic information. Select Next.
-
In the list, locate and select the ApplicationImpersonation admin role. Select Next.
-
In Members, select your Office 365 admin account. The account must have a mailbox configured in Exchange Online. Select Next.
-
Select Add role group.
-
Step 2: Enable mail app access in Microsoft 365
-
Sign in to the Microsoft 365 admin center.
-
Go to Active users.
-
For each user in the list, do the following:
-
Select user's display name.
-
In the dialog that opens, select the Mail tab.
-
Select Manage email apps.
-
In the dialog that opens, select check boxes next to all apps except Outlook desktop (MAPI) and IMAP.
-
Save your changes.
-
Step 3: Register Sage CRM as a new app in Entra ID
-
Sign in to the Microsoft Entra admin center as an administrator.
-
Go to App registrations.
-
Register a new application:
-
Select New registration.
-
Enter a descriptive name for the application.
-
Under Supported account types, select one of the following:
-
Accounts in this organizational directory only (Default Directory only - Single tenant) if you want your Sage CRM app to support a single tenant.
-
Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) if you want your Sage CRM app to support multiple tenants.
Sage CRM does not support other options under Supported account types.
-
-
-
Under Redirect URI (optional), select Public client/native (mobile & desktop) and enter the following URIs:
Copyhttps://{server name}/{install name}/custompages/oauth/callback.html
If your Sage CRM server is accessible on the internet, also add:
Copyhttps://{server FQDN}/{install name}/custompages/oauth/callback.html
In these URIs:
-
{install name} is the name of your Sage CRM installation. It must be all lowercase.
-
{server name} is the name of the Sage CRM server. It must be all lowercase.
-
{server FQDN} is the fully qualified domain name of the Sage CRM server. It must be all lowercase.
-
-
Select Register.
-
Copy the application (client) ID that displays and store it in a file.
-
Go to API permissions and add the following Microsoft Graph delegated permission for your app:
-
EWS.AccessAsUser.all
-
Step 4: Configure Exchange Integration in Sage CRM
-
Open a web browser on the Sage CRM server and enter the Sage CRM access URL.
For example:
Copyhttps://myserver/crm
-
Log on to Sage CRM as a system administrator.
-
Go to <My profile> | Administration | System | System Behavior and click Change.
-
Make sure that Use Exchange Integration is set to Yes.
-
Go to <My profile> | Administration | Emails and Documents | Exchange Integration | Connection Management and click New.
-
Complete the following options:
-
In Exchange type, select Exchange Online (Office 365).
-
In Exchange Web Service URL, enter the following:
Copyhttps://outlook.office365.com/EWS/Exchange.asmx
-
In Application (client) ID, enter the ID you copied in Step 3: Register Sage CRM as a new app in Entra ID.
-
In Supported account type, enter one of the following values, depending on how your app in Entra ID is configured:
-
common. Enter this value if your app in Entra ID supports multiple tenants.
-
{Tenant ID} or {domain name}. Enter a tenant ID or domain name if your app in Entra ID supports a single tenant.
-
-
OAuth authority URL shows the authentication URL that Sage CRM uses for the specified account type, that is, https://login.microsoftonline.com/{account type}/oauth2/v2.0, where {account type} is either common or {tenant ID}/{domain name}.
-
-
Select Save.
You may be prompted to sign in to your Office 365 admin account and grant permissions to the Sage CRM app you have registered earlier.