Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to Retrieve Files from Sharepoint Library with AEM Custom Component | AEM Community Blog Seeding




How to Retrieve Files from Sharepoint Library with AEM Custom Component by Jakub Olszyna


This article shows how to easily integrate your AEM component with Sharepoint and retrieve all files from specified library using Microsoft Graph API.

1. AEM 6.5.x
2. Java 11
3. An application registered with the Microsoft Identity Platform with the http://localhost:4502/content/example/ms-graph-callback.html added as 4. the redirect URI [1]
5. AEM project to work on (i.e. created using aem-project-archetype [2])
6. A sharepoint site (i.e. https://{hostname}/{site})

Create component
First we need to create new AEM component that will display files from Sharepoint. Let’s add a simple html with a placeholder for the actual files and a corresponding js that will handle all the logic. Sharepoint site params (hostname, site and list) should be enough to define which documents our component should display.


var sharepointFileList = (hostname, site, list) => {
var _init = () => {
Request user authorization
To use Microsoft Graph to read and write resources on behalf of a user, your app must get an access token from the Microsoft identity platform and attach the token to requests that it sends to Microsoft Graph.
The first step to getting an access token is to open new pop-up window and redirect the user to the Microsoft identity platform authorize endpoint with required scope. In our case it scope should at least contain Sites.Read.All to allow read-only access to users resources. The user organization is defined as the tenant and appId corresponds to the Application ID that the registration portal assigned your app.

Read Full Blog

How to Retrieve Files from Sharepoint Library with AEM Custom Component


Please use this thread to ask the related questions.


Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies