# SharePoint Microsoft Graph REST API Application Client Secret

---

#### Remote item name: **SharePoint**

**Integration Type**: Application Permission\
**Authentication Method**: Client Secret

The Microsoft Graph API is a unified REST endpoint for all Microsoft 365 services, treating SharePoint simply as another data source alongside Teams, Outlook, and OneDrive. It allows you to access SharePoint resources like sites, drives, and list items through the single graph.microsoft.com endpoint, using a consolidated permission model.

---

**🛑 Proxy Configuration:** If your environment uses a Proxy or a strict Firewall, you must authorize outbound traffic to the following Microsoft endpoints.

• login.microsoftonline.com\
• graph.microsoft.com

---

Open the **Microsoft Entra Admin Center** (formerly Azure AD) to manage your app registration: [Microsoft Entra Admin Center Link](https://entra.microsoft.com/)

Navigation: Go to **App registrations**. Click on New registration.

![New registration](SharePoint-Integration/new_registration.png)

**Configure API Permission**: Navigate to API Permissions. Click on Add a permission button. Select **Microsoft Graph**. Then select **Application Permission**. Search for **Files** and check the flag **Files.ReadWrite.All** permission.

![Ms graph app permission](SharePoint-Integration/ms_graph_app_permission.png)

**🛑 Important:** Grant **Admin consent** for the newly added permission.

![App permission admin consent](SharePoint-Integration/app_permission_admin_consent.png)

Fetch the application credentials from your App Registration to enable the integration:

**Client id**: See at App Registration -> Overview -> Application (client) ID

![Client id](SharePoint-Integration/client_id.png)

See at App Registration -> **Certificates & secrets**

Go to Certificates & secrets, and generate a new client secret by clicking on New client secret. ⚠️ Ensure you copy over the **value** immediately!

![New secret](SharePoint-Integration/new_secret.png)

![Secret value](SharePoint-Integration/secret_value.png)

![App permission vfs item](SharePoint-Integration/app_permission_vfs_item.png)

Select the **Application Permission** radio button, then click **Application Permission** button.\
![App permission client secret form](SharePoint-Integration/app_permission_client_secret_form.png)\
Enter the **Client ID** (See at App Registration -> Overview -> Application (client) ID),**Client Secret** (See at App Registration -> Manage -> Certificates & secrets). ⚠️ Make sure to copy the **value** field, not the ID.\
**Tenant ID** (See at App Registration -> Overview -> Directory (tenant) ID), then click OK. This will automatically configure the **username** and **password** in the [VFS](VFS.md) item settings.

**Tennant:** See at App Registration -> Overview -> Directory (tenant) ID. Based on the App Registration Account type, it can be an ID, common, or consumer.

**Identifying the SharePoint Target**: You must define which part of SharePoint the VFS should connect to. You can either link to a **full Document Library** or a **specific subfolder**.

**Link an Entire Document Library**:

In your web browser, open your SharePoint site and navigate to the **Document Library**. Copy the complete URL from your browser's address bar.

![Shared link document library](SharePoint-Microsoft-Graph-REST-API/shared_link_document_library.png)

It will look similar to this:

```
https://your.sharepoint.com/sites/your_site/Shared%20Documents/Forms/AllItems.aspx
```

**Link a Specific Subfolder**: If you only want the VFS to access a specific subdirectory, use a **Direct Link**:

![Shared link specific folder](SharePoint-Microsoft-Graph-REST-API/shared_link_specific_folder.png)\
In your web browser, open your SharePoint site and navigate to the **Document Library**, and find the specific folder you want to link to. Right-click on the folder. Select **Copy link** from the context menu that appears.\
It will look similar to this:

```
https://your.sharepoint.com/:f:/s/your_site/Evxo0AjlwiZAnajkk56_AC0BDxGQDy7bgNu8F7HHgVMKtQ?e=BgvJps
```

Return to the VFS settings and paste the URL into the **Shared Link** input field.

Click the **Test** button to verify the connection. If successful, click **OK** and then Save your changes.

![Sharepoint app cleint secret vfs success](SharePoint-Microsoft-Graph-REST-API-Application-Client-Secret/sharepoint_app_cleint_secret_vfs_success.png)

---

Back to [SharePoint Integration](SharePoint-Integration.md)

---
