> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/m/microsoft-sharepoint-certificates.md).

# Microsoft Sharepoint Certificates

This adapter reads one SharePoint list through Microsoft Graph and turns each row into a certificate record.

## Use cases

* Find certificates from your SharePoint list that are about to expire.

```
Adapters = microsoft-sharepoint-certificates AND ExpiryStatus = expiring
```

* Find certificates from your SharePoint list that already expired.

```
Adapters = microsoft-sharepoint-certificates AND ExpiryStatus = expired
```

## Before you begin

### Network

| Source              | Destination               | Port | Protocol |
| ------------------- | ------------------------- | ---- | -------- |
| OctoXLabs connector | login.microsoftonline.com | 443  | HTTPS    |
| OctoXLabs connector | graph.microsoft.com       | 443  | HTTPS    |

### Required permissions

| Scope or role                                 | Permission | Needed for                                                      |
| --------------------------------------------- | ---------- | --------------------------------------------------------------- |
| Sites.Read.All (Microsoft Graph, application) | Read       | Reading the SharePoint site and list items                      |
| Files.Read.All (Microsoft Graph, application) | Read       | Listed in the frontend instructions for the SharePoint adapters |

The permission list comes from the frontend instructions of the SharePoint adapters.

## Create credentials in Microsoft Sharepoint Certificates

{% stepper %}
{% step %}

### Register an application

Sign in to the Azure Portal as an administrator, open Azure Active Directory and select App registrations > New registration. Fill in the details and select Register. The Application (client) ID and Directory (tenant) ID are shown.
{% endstep %}

{% step %}

### Create a client secret

Select Certificates & Secrets > New client secret. Select Add and copy the generated secret value at once.
{% endstep %}

{% step %}

### Add API permissions

Select API Permissions > Add a permission > Microsoft Graph > Application permissions. Add Sites.Read.All and Files.Read.All.
{% endstep %}

{% step %}

### Grant admin consent

Select Grant admin consent.
{% endstep %}

{% step %}

### Find the list address

Your list URL has the form `https://SharepointDomain/FolderType/YourSite/Lists/ListName`. You need the domain, folder type, site address and list name from it.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
These SharePoint adapters read one SharePoint list. Each list row becomes one asset. You tell OctoXLabs which list column holds each field. Enter column names without spaces. Columns you do not map stay available as adapter specific data under their display names.
{% endhint %}

## Connection parameters

| Parameter                                               | Required | Type    | Default | Description                                                                |
| ------------------------------------------------------- | -------- | ------- | ------- | -------------------------------------------------------------------------- |
| Tenant ID (`tenant_id`)                                 | Yes      | String  |         | Directory (tenant) ID.                                                     |
| Client ID (`client_id`)                                 | Yes      | String  |         | Application (client) ID.                                                   |
| Client Secret (`client_secret`)                         | Yes      | String  |         | Client secret value.                                                       |
| Sharepoint Domain (`sharepoint_domain`)                 | Yes      | String  |         | Host name of the site collection, for example `yourtenant.sharepoint.com`. |
| Folder Type (`folder_type`)                             | Yes      | String  |         | Folder type of the site collection, for example `personal` or `marketing`. |
| Site Address (`site_address`)                           | Yes      | String  |         | Server-relative path of the site, for example `your_site_com`.             |
| List Name (`list_name`)                                 | Yes      | String  |         | Name of the list. It is the last part of the list URL.                     |
| SSL (`is_secure`)                                       | No       | Boolean | True    | Use HTTPS for the token request.                                           |
| Timeout (`timeout`)                                     | No       | Integer | 30      | Seconds to wait for API responses.                                         |
| Primary Key Field (`primary_key_field`)                 | Yes      | String  |         | List column that identifies each certificate record.                       |
| Certificate Content Field (`certificate_content_field`) | No       | String  |         | List column with the raw certificate content (PEM).                        |
| Expiry Field (`expiry_field`)                           | No       | String  |         | List column with the expiry date.                                          |
| Name Field (`name_field`)                               | No       | String  |         | List column for the name (subject common name).                            |
| Created Date Field (`created_date_field`)               | No       | String  |         | List column for the creation date.                                         |
| Issuer CN Field (`issuer_cn_field`)                     | No       | String  |         | List column for the issuer common name.                                    |
| Subject CN Field (`subject_cn_field`)                   | No       | String  |         | List column for the subject common name.                                   |

## Troubleshooting

| Error message | Cause | Fix                                    |
| ------------- | ----- | -------------------------------------- |
| Not verified  |       | No adapter-specific error text in code |

## Change history
