Enabling Liferay’s REST Connector to SharePoint
Requires DXP Subscription; Compatible with SharePoint 2016 and SharePoint Online
Liferay’s REST Connector to SharePoint integrates Documents and Media with SharePoint libraries. Create repositories to mount SharePoint libraries, manage documents and folders, check in and check out files, download content, and more. Changes in one system propagate to the other.
Integration Limitations
This application uses SharePoint’s API and has some limitations:
- Moving or renaming a file without checking it out first removes version history.
- You can’t change file extensions; you can only change file names.
- A file’s name updates across all previous versions.
- Only the user who checks out a file can see its working copy’s version number.
- Queries using suffixes or intermediate wildcards act as containment queries.
- Comments, ratings, and using a SharePoint folder as a Documents and Media root folder are unsupported.
For more information on how the REST connector works, see the javadocs API reference.
Installing the REST Connector
-
Download the Liferay REST Connector to SharePoint as an LPKG file via the Liferay Marketplace.
-
Copy the file to the instance’s
[LIFERAY_HOME]/deploy
folder to deploy it.The following message appears in the console logs:
Processing Liferay REST Connector to SharePoint.lpkg The portal instance needs to be restarted to complete the installation of file:/opt/liferay/osgi/marketplace/Liferay%20REST%20Connector%20to%20SharePoint%20-%20API.lpkg
-
Restart the server to complete installation.
After installation, configure SharePoint OAuth2 to complete the setup. You can also define custom search sources to refine SharePoint search results.
The REST connector uses Azure ACS with OAuth2 for SharePoint server authorization. Ensure HTTPS support is enabled on your server.
Updating to the Latest Version
Previously, the Liferay REST Connector to SharePoint was named Liferay Connector for SharePoint. If an older version of the application is installed, follow these steps to update to the latest version:
-
Download the Liferay REST Connector to SharePoint as an LPKG file via the Liferay Marketplace.
-
Stop the Liferay DXP server.
-
Navigate to the
[LIFERAY_HOME]/osgi/marketplace
folder and replace the old LPKG file with the new one. -
Restart the Liferay DXP server.
Once the server restarts, the application is ready for use.
Adding a SharePoint OAuth2 Configuration
-
Open the Global Menu (
), click on the Control Panel tab, and go to System Settings → Documents & Media → SharePoint OAuth 2.
-
Click Add to create a new SharePoint OAuth2 configuration entry.
-
Fill out the form (see below).
-
Click Save when finished.
Name: The configuration’s name
Authorization Grant Endpoint: The URL used to request OAuth2 authorization grants (e.g., https://[your-site-name].sharepoint.com/_layouts/oauthauthorize.aspx
for SharePoint Online)
Authorization Token Endpoint: The ACS URL (e.g., https://accounts.accesscontrol.windows.net/[App ID]/tokens/OAuth/2
for SharePoint Online)
Client ID: The client ID
Client Secret: The client secret
Scope: The permission set required for your tokens; valid scopes are configured during the REST Connector’s registration
Tenant ID: The Tenant ID
Site Domain: The site domain registered for your application
Resource: This value depends on the ACS service you use (e.g., 00000003-0000-0ff1-ce00-000000000000/[your-site-name].sharepoint.com@[tenant ID]
for SharePoint Online).
Once saved, the SharePoint configuration can be used to create repositories in Documents and Media that are mounted to SharePoint libraries.
Adding a SharePoint Search Configuration
This configuration was removed in Liferay DXP 2023.Q4/Portal GA102 and is not applicable to newer versions.
With SharePoint, you can define custom source IDs to restrict and fine-tune search results. By default, the connector uses the Documents source ID.
To create SharePoint Search configuration with a different source ID,
-
Open the Global Menu (
), click on the Control Panel tab, and go to System Settings → Documents & Media → SharePoint Search.
-
Click Add to create a new SharePoint Search configuration entry.
-
Enter a custom SharePoint Results SourceID for the new entry.
-
Click Save when finished.