cogIntegration of Office365 in XWiki
Developed by

Ludovic Dubost

Active Installs36
0 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager


You can also try the Pro version: Office365 Integration (Pro).

Integration of Office365 in XWiki

This macro connects XWiki to Office365, allowing to display office documents from OneDrive inside XWiki. It allows to search for OneDrive documents on the XWiki search page.


  • Only Office formats (Word, Excel, Powerpoint) can be embedded. PDF cannot because Office 365 does not provide an embed URL.
  • Sharepoint documents can be embedded by URL but not searched.

Macro embed via URL

First you can embed an Office 365 documents by URL. This way of embedding does not require OAuth credentials to connect XWiki. To embed you just need to get the URL that is displayed when you view or edit an Office document on Office 365. An iframe is used to embed. You can also set width and height parameters of the iframe.

{{office365 url="" width="100%" height="800" /}}


Macro embed via Search

You can embed via search. Just insert the office365 macro without any parameter and a search box will show up. You need to set OAuth credentials in the configuration for this to work (see configuration). You search and then choose the document to embed. To links ("change" and "view" are displayed to allow to change the embed document or view the document on Office365).

{{office365 /}}


OneDrive search inside XWiki

If you setup OAuth credentials, activate the search UI extension in the Office 365 configuration in the XWiki administration  and add the UI Extension point to the SolrSearchMacros page (see installation instructions) you will see a box showing up on the SOLR search screen of XWiki when searching. This box shows OneDrive results. 


Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

To configure the extension to be able to use the other features, you will need to get OAuth2 credentials:

Create Office 365 OAuth Credentials

You will need to create credentials on Office 365/Azure AD. This can be done either in Azure AD or on this microsoft app registration web site. It might be necessary to be an admin in the organization

It is necessary to get an Application ID (clientid), create a password (secret)
and set the redirect URI ( http://[your domain]]/xwiki/bin/view/Office365/OAuth (or https) )


Permissions need to be set on the Graph API like below:


Here are some screenshots of the checkboxes checked on the Application Registration Portal:


In case you register the key using the Azure Portal here is how the rights should look


Enter the credentials in XWiki Administration

You will need to enter your credentials and your tenant ID (either or the full ID) in the Office365 section of the XWiki Administration.

Add the UI Extension point to the Main.SolrSearchMacro page

A UI Extension point needs to be added until is integrated in XWiki.

To add the extension point locate #\displaySearchForm in the page Main.SolrSearchMacros and add the foreach/end block after it:

    #foreach ($extension in $services.uix.getExtensions(""))
{{html clean=false}}
$services.rendering.render($extension.execute(), 'xhtml/1.0')
    #if ($text != '')

Release Notes


Minor fix: Missing sites configuration in config page


  • Added support for PDF Viewing
  • Added support for searching and embedding documents from sharepoint sites


  • Initial Release
  • Allows to search and embed documents from your personal drive on Office365
  • Allows to show search results from your personal drive in the XWiki Search


Dependencies for this extension (org.xwiki.contrib:application-office365 1.1.1):


Get Connected