Set up SharePoint client credentials
This guide is for Microsoft 365 administrators. It walks you through registering an app in Microsoft Entra ID (formerly Azure AD) from the Microsoft 365 admin center at https://admin.microsoft.com, and obtaining the client credentials Mammoth needs to download files from SharePoint using the Microsoft Graph API.
What the app does and the permissions it needs
- The app will get secure access tokens via MSAL to list and download files from SharePoint document libraries.
- Recommended permissions (Application type):
Sites.Read.All
- These are Application permissions (not Delegated), so they require admin consent.
Prerequisites
- You must sign in with a Global Administrator or Application Administrator account in your Microsoft 365 tenant.
Step 1: Sign in to the Microsoft 365 admin center
- Go to https://admin.microsoft.com and sign in with your admin account.
- In the left navigation pane, click All admin centers (near the bottom).
- Select Microsoft Entra.
- Click Go to Microsoft Entra ID (or Go to Entra admin center).
You are now in the Microsoft Entra admin center (https://entra.microsoft.com).
Step 2: Register a new application
-
In the left menu, expand Entra ID → click App registrations.
-
Click + New registration at the top.
-
Fill in the form:
- Name: Enter something clear, e.g.,
SharePoint-File-Downloader. - Supported account types: Select the appropriate account type.
- Redirect URI: Leave blank (not needed for app-only/daemon apps).
- Name: Enter something clear, e.g.,
-
Click Register.
Step 3: Note your app credentials (client ID and tenant ID)
After registration, you land on the app Overview page.
- Copy and save securely:
- Application (client) ID → This is your
client_id. - Directory (tenant) ID → This is your
tenant_id.
- Application (client) ID → This is your
Tip: Store the IDs securely
Paste these into a secure note or a password manager. You need them when you connect SharePoint in Mammoth.
Step 4: Add Microsoft Graph API permissions (Sites.Read.All)
- In the left menu (under Manage), click API permissions.
- Click + Add a permission.
- Select Microsoft Graph.
- Choose Application permissions (important for app-only access).
- In the search box, type:
Sites.Read.All→ select it.
- Click Add permissions.
You should now see the permissions listed under Configured permissions.
Step 5: Grant admin consent
- Still on the API permissions page, click Grant admin consent for [Your Tenant Name].
- Review the permissions in the pop-up.
- Click Accept / Yes.
Status should now show “Granted for [Your Tenant]” for each permission.
Step 6: Create a client secret
- In the left menu (under Manage), click Certificates & secrets.
- Under Client secrets, click + New client secret.
- Enter a Description (e.g., “SharePoint downloader secret”).
- Choose an expiration period (for example, 6 or 12 months; shorter is more secure).
- Click Add.
Warning: The secret value appears only once
The Value of the secret appears only once. Copy it immediately and store it securely with your client_id and tenant_id. This is yourclient_secret.
Step 7: Verify the registration (optional)
- Go back to Overview → confirm Client ID and Tenant ID.
- Go to API permissions → confirm consent is granted.
- Go to Certificates & secrets → confirm the secret is listed (Value is hidden).
Step 8: Get the SharePoint site URL
The most straightforward method is to navigate to the SharePoint site and check the URL in your browser's address bar.
-
The Format: This usually appears as
https://[your-domain].sharepoint.com/sites/[site-name]or simplyhttps://[your-domain].sharepoint.comfor the default site. -
Common mistake: Make sure you are not copying the URL of a specific file or a deep sub-folder.
-
Correct:
.../sites/Marketing -
Too Deep:
.../sites/Marketing/Shared%20Documents/Forms/AllItems.aspx
-
With the client ID, tenant ID, client secret, and site URL ready, you can connect your Mammoth workspace to SharePoint using the SharePoint connector.