Skip to content

Microsoft 365 Connector

The Microsoft 365 Connector connects a Drupal site to one or more Microsoft 365 tenants. It handles the OAuth2 dance with Microsoft, keeps the tokens, and gives your code a service to call the Microsoft Graph API with. The submodules use that service to put Microsoft 365 data on the site: single sign-on, profile pictures and presence, Outlook mail and calendar, OneDrive and SharePoint files, Teams.

The base o365 module on its own does nothing a visitor can see. It is the plumbing. Enable the submodules for the parts you actually want.

Before you start

You need someone who can register an application in the Microsoft Entra admin center (the old Azure portal) for the tenant you want to connect to, and who can grant that application Microsoft Graph permissions. At a lot of organizations that is not the same person who builds the Drupal site, so plan for a wait there.

The 6.0.x change you should know about

In 5.x there was one set of API credentials, entered in settings.php under $settings['o365']['api_settings'], and the authorization scopes were a field on the module settings page.

6.0.x replaced that with connector entities. A connector is a configuration entity that represents one app registration: it holds the scopes and the redirect target, and it is exported with your configuration. The client ID, client secret and tenant ID stay out of configuration and live in settings.php, keyed by the machine name of the connector. That is what lets a site talk to more than one tenant, and it is also the part people get wrong most often, because the key in settings.php and the machine name of the connector have to match exactly.

Reading order

  1. Setting up an Azure app
  2. Installing and configuring the module
  3. Submodules
  4. Technical documentation, for when you write code against the connector

Getting help