Certificate-based authentication provides a secure way to connect to SharePoint and supports both basic integration and
permission sync functionality.Use certificate authentication when:
You need permission sync capabilities
You prefer certificate-based security over client secrets
Your organization requires certificate-based authentication
If you are not planning to enable permission sync, you only need basic permissions:
1
Choose Microsoft Graph
Click Microsoft Graph, then click on Application permissions.
2
Select Sites.Read.All
Navigate to the “Sites” permission group. Select the checkbox for Sites.Read.All.
Advanced: If you want to limit the sites this app has access to, select Sites.Selected.
However, if you do this, you will need to add the App you are currently registering to each site you want to index.
How to grant site-specific access
If you selected Sites.Selected, you need to grant your app read access to each site you want to index.The steps below use Microsoft Graph Explorer,
but you can also grant site permissions using:
Sign in with a Global Admin or SharePoint Admin account.
2
Consent to permissions
Click your profile icon → Consent to permissions → enable Sites.FullControl.All.
This grants Graph Explorer (not your Onyx app) permission to manage site access.
3
Get the site ID
Run a GET request, replacing {tenant} and YourSiteName:
GET https://graph.microsoft.com/v1.0/sites/{tenant}.sharepoint.com:/sites/YourSiteName?$select=id
Copy the id from the response (format: onyx.sharepoint.com,guid1,guid2).
4
Grant Read permission
Change the method to POST:
POST https://graph.microsoft.com/v1.0/sites/{site-id}/permissions
If you plan to enable permission sync, you’ll need additional permissions:
1
Add another permission
Click Add a permission again.
2
Microsoft Graph application permissions
Click Microsoft Graph, then click on Application permissions.
Add the following additional Microsoft Graph permissions:
Directory.Read.All - Used to query the overall organizational directory structure, including how users,
groups, organizational units, and other directory objects relate to each other.
Group.Read.All - Used to read detailed group-specific information such as group properties, settings,
types (Security vs Microsoft 365), and configurations.
GroupMember.Read.All - Used to retrieve and expand all members within a group,
including nested group memberships.
This allows Onyx to determine which users have access to SharePoint content through group membership.
Member.Read.Hidden - Allows reading memberships of security groups that are marked as “hidden” in Entra ID.
User.Read.All - Used to retrieve complete user profiles and enumerate all users in the directory.
Click Add permissions.
3
Microsoft Graph delegated permission
Click Add a permission again in API Permissions tab. Click Microsoft Graph,
then click on Delegated permissions. Add the following delegated permission:
User.Read - This delegated permission allows the application to sign in on behalf of a user and read the
signed-in user’s basic profile information. Unlike application permissions which work without a user context,
this delegated permission is required when the app needs to establish an authenticated identity context for making
API calls to Microsoft Graph and SharePoint. It provides the minimum required access for user authentication flows.
Click Add permissions.
4
SharePoint application permissions
Click Add a permission again in API Permissions tab. Click SharePoint,
then click on Application permissions. Add the following SharePoint permissions:
Sites.FullControl.All - Despite the name, Onyx only uses this to retrieve details about permissions.
No write operations are performed.
If you selected Sites.Selected and need to grant fullcontrol only for specific sites,
see the Using Sites.Selected with Permission Sync section below.
User.Read.All - Used to list all users within the directory for permission mapping.
Click Add permissions.
5
Grant admin consent
Finally, click Grant admin consent for <Organization name> and click Confirm.
Using Sites.Selected with Permission Sync
If you selected Sites.Selected instead of Sites.Read.All and plan to enable permission sync,
you need to grant your app fullcontrol access to each site.The steps below use Microsoft Graph Explorer,
but you can also grant site permissions using:
Sign in with a Global Admin or SharePoint Admin account.
2
Consent to permissions
Click your profile icon → Consent to permissions → enable Sites.FullControl.All.
This grants Graph Explorer (not your Onyx app) permission to manage site access.
3
Get the site ID
Run a GET request, replacing {tenant} and YourSiteName:
GET https://graph.microsoft.com/v1.0/sites/{tenant}.sharepoint.com:/sites/YourSiteName?$select=id
Copy the id from the response (format: onyx.sharepoint.com,guid1,guid2).
4
Grant FullControl permission
Change the method to POST:
POST https://graph.microsoft.com/v1.0/sites/{site-id}/permissions