Certificate-Based Authentication¶
Certificate-based authentication allows TreeSize to identify itself to the authentication service using a digital certificate instead of user credentials.
Before starting, ensure you have:
Administrative access to your Entra ID app registration
Permission to create certificates on your system
Step-by-Step Setup Guide¶
Step 1: Create a Self-Signed Certificate¶
For creating a certificate file the command New-PnPAzureCertificate for PowerShell is used. Visit the documentation for reference.
Note
In order to use this command you need to import the PnP.PowerShell module using the command: Import-Module PnP.PowerShell
Generate the certificate files:
Create both a
.cerfile (public certificate) and a.pfxfile (private key with certificate)Use a descriptive name for your certificate (e.g., “Auth-Cert”)
Note
We recommend using “Example 3” in the documentation as reference for creating a certificate with password.
Verify certificate creation:
Confirm both
.cerand.pfxfiles are createdNote the certificate thumbprint for future reference
Store the
.pfxfile securely with its password
Step 2: Configure Entra ID Registration¶
Upload the certificate:
Navigate to your Entra ID app registration
Go to “Certificates & secrets” section
Click “Upload certificate”
Select and upload the
.cerfile created in Step 1
Step 3: Configure API Permissions¶
Add SharePoint permissions:
Go to “API permissions” in your app registration
Click “Add a permission”
Select “SharePoint” from the Microsoft APIs
Choose “Application permissions”
Add
Sites.Selectedpermission
Note
Make sure that steps c and d are correctly configured for the granted permission or it might later lead to an incorrect authentication.
The Sites.Selected permission allows your application to access only specific SharePoint site collections that have been explicitly configured, providing granular security control.
Grant admin consent:
Click “Grant admin consent” for your organization
Confirm the permission is granted (status shows green checkmark)
Step 5: Configure TreeSize¶
Certificate configuration:
When prompted, configure TreeSize to use the
.pfxfile for authentication when creating a scanProvide the path to the certificate file and the certificate password