Setup (Selected sites)
Use Sites.Selected to limit the SharePoint app to explicitly granted sites. The SharePoint app uses its own client ID and certificate, while the Microsoft 365 parent connector provides identity crawling and the tenant ID.
Set up the parent connector first. If your SharePoint credential fields show inherited credentials, contact your Glean Deployment Engineer before changing app permissions or switching to a site-limited app. You do not need to recreate the connection. See Microsoft 365.
Before you begin the selected-sites setup, contact your Glean Deployment Engineer. Your deployment configuration must be updated before
Sites.Selected permissions will work. Starting setup without this step may result in errors.
Sites.Selected compared to Sites.FullControl.All
Before choosing Sites.Selected, consider that Glean respects the permissions set in your source applications — users only see content in Glean that they can access in SharePoint.
Glean's Sensitive findings dashboard helps you manage and protect sensitive data across all connected applications. Use Sensitive findings to detect broadly shared, externally exposed, or overshared sensitive data and maintain compliance with data protection regulations.
Sites.FullControl.All provides tenant-wide access and supports automatic site discovery. Sites.Selected limits app access to explicitly granted sites, requires ongoing site-list maintenance, and does not provide Microsoft user-activity insights used for ranking and personalization.
Sites.FullControl.All
- Grants full control over all SharePoint sites in the tenant with no need to manually add sites.
- Requires one-time setup — the admin grants permissions once, and Glean includes new sites automatically.
- Supports Microsoft user-activity insights used for search ranking and personalization.
- Supports webhook notifications and permission-change tracking. Update timing depends on crawl configuration and completion.
- Allows admins to use greenlists and redlists to control which sites Glean crawls.
- Reduces management overhead and produces fewer errors.
Sites.Selected
- Limits access to specific SharePoint sites that the admin explicitly grants.
- Requires manual configuration for each site through PowerShell — the admin must notify Glean of any changes.
- Does not automatically include new sites — admins must update the list and inform Glean for each addition.
- Does not provide Microsoft user-activity insights used for ranking and personalization, which can reduce result quality. Other ranking inputs, including indexed content and Glean interactions, can still contribute.
- Requires planning for content and permission updates whose timing varies with crawl configuration and completion.
- Increases management overhead and the risk of errors or mismatches.
- Has led some customers to report user confusion and a degraded search experience due to missing content.
Comparison
The table compares access scope and setup requirements. Neither option guarantees a fixed refresh interval.
| Feature | Sites.FullControl.All | Sites.Selected |
|---|---|---|
| Scope | All sites | Only specified sites |
| Setup | One-time | Manual per site |
| Automatic site detection | Yes | No |
| Microsoft user-activity insights for ranking | Supported | Unavailable |
| Management overhead | Low | High |
| Security risk (if not mitigated) | Higher | Lower |
| Supported by Glean | Yes | Yes |
Security mitigations for FullControl
- Use greenlists/redlists to restrict crawl scope.
- Apply IP restrictions to limit API calls to Glean infrastructure.
- Monitor and audit all access.
- Store credentials securely and rotate keys regularly.
Connect to SharePoint
Complete the app configuration, certificate setup, per-site grants, and inclusion rules in order. These steps use certificate authentication, not Azure Access Control Services (ACS) or appinv.aspx.
Required permissions for setup
Have the Microsoft 365 Global Administrator role to configure app permissions and grant consent for this setup. See About admin roles in the Microsoft 365 admin center.
The user who runs the delegated site-permission grant must be a SharePoint Administrator or higher and a member of the target site. Granting app consent and running site grants are separate operations and can involve different administrators. See Create permission.
Register a new app
Create a dedicated SharePoint app for a new site-limited setup. Reuse an existing app only if its application permissions already match this site-limited configuration.
- Sign in to the Azure portal.
- Select Microsoft Entra ID → Manage → App registrations → New registration.
- Enter a name such as
Glean SharePoint, select Accounts in this organizational directory only (Single tenant), and leave Redirect URI blank for now. - Click Register.
Configure permissions
Adding Sites.Selected does not restrict permissions already granted. An app with Microsoft Graph application Files.ReadWrite.All or Sites.FullControl.All, or SharePoint application Sites.FullControl.All, still has tenant-wide access. Use a new dedicated site-limited app, or coordinate conversion with your Glean Deployment Engineer. Do not remove broad permissions from a shared parent app to make SharePoint site-limited, because OneDrive or other connectors may depend on them.
- Open the SharePoint app registration and select Manage → API permissions.
- Select Add a permission → Microsoft Graph → Application permissions and add
Sites.Selected. - Select Add a permission → SharePoint → Application permissions and add
Sites.Selected.

Select Application permissions for the SharePoint crawler app.
Keep the identity permissions on the Microsoft 365 parent app. Use Sites.Selected on both APIs for the site-limited crawler app, without tenant-wide application permissions for SharePoint content.
Grant admin consent
- Sign in to Azure as a Global Administrator.
- Open Enterprise applications and select the SharePoint app.
- Select Security → Permissions, review the Graph and SharePoint
Sites.Selectedapplication permissions, and click Grant admin consent.
Consent alone does not give the app access to a site. Complete the per-site FullControl grants before validating the connector.
Install OpenSSL
Use OpenSSL to generate the certificate and private key. If it is not installed, choose a binary distribution for your operating system. See OpenSSL binary distributions.
On Windows, install a distribution such as Win32/Win64 OpenSSL and select the option to copy the binaries into the /bin directory. Open a new PowerShell session and add the installation directory to its path, adjusting the path if needed:
$env:Path += ";C:\Program Files\OpenSSL-Win64\bin"
Generate certificate and private key
-
Run these commands in order to create an unencrypted private key in the
PKCS#8format and its certificate:openssl genrsa -out tempprivatekey.key 2048openssl pkcs8 -topk8 -inform PEM -outform PEM -in tempprivatekey.key -out privatekey.key -nocryptopenssl req -new -key privatekey.key -out request.csropenssl x509 -req -days 365 -in request.csr -signkey privatekey.key -out certificate.crt -
Verify that
certificate.crthas the boundary labelsBEGIN CERTIFICATEandEND CERTIFICATE. -
Verify that
privatekey.keyhas the boundary labelsBEGIN PRIVATE KEYandEND PRIVATE KEY. The key must not be encrypted or includeRSAin the headers.
Upload the certificate to Azure
- Open the SharePoint app under Microsoft Entra ID → Manage → App registrations.
- Select Manage → Certificates & secrets → Certificates → Upload certificate.
- Upload
certificate.crtand confirm that it appears in the app's certificate list.

Upload the certificate to the SharePoint app. The example app is named Glean.
Fill out keys
- Open Overview in the SharePoint app registration and copy its Application (client) ID.
- In Glean, open the SharePoint connector's Setup tab or Set up indexing step. Enter that client ID and upload
certificate.crtandprivatekey.key. - Keep the tenant ID inherited from the Microsoft 365 parent. It is read-only when shown in the previous interface and hidden in the new indexing form.
- Enter your SharePoint domain, such as
company.sharepoint.com. It must end withsharepoint.com.
Don't register extra apps for crawl speed. If additional apps are already configured, keep them in place and maintain their permissions, certificates, and per-site grants.
If Glean shows inherited credentials, manage them on the parent connector only after confirming the site-limited configuration with your Glean Deployment Engineer. Keep any existing additional apps in that displayed flow, and verify that each crawler app meets the same site-limited permission requirements. Complete the per-site grants before clicking Save or Continue.
For native real-time access, configure delegated permissions and the redirect URI on the default app, not on additional crawler apps. See Set up real-time access for SharePoint.
Grant SharePoint API permissions to individual apps
Grant FullControl on every site collection you want to index to the SharePoint app and each additional crawler app configured for it. This access is required to retrieve individual list-item permissions through the SharePoint API. The app you use to administer these grants can be different from the crawler apps receiving them.
Install PnP PowerShell
Use a PowerShell version supported by the PnP PowerShell release you install. Check the current version requirement in Installing PnP PowerShell. If needed, install PowerShell first. See Install PowerShell on Windows.
Run these commands in the supported PowerShell version:
Install-Module -Name PnP.PowerShell
Import-Module PnP.PowerShell
Provision site permissions
On the provisioning app, select API permissions → Add a permission → Microsoft Graph → Delegated permissions, add Sites.FullControl.All, and grant admin consent. This scope authorizes the site-permission grant command. It is separate from the Sites.Selected application permissions used for crawling, and you can remove it after provisioning if no other workflow needs it.
Sign in as a SharePoint Administrator or higher who is also a member of the target site. Admin consent to the provisioning app does not replace these grant-user requirements.
-
Confirm that the certificate is uploaded to every SharePoint crawler app configured in Glean.
-
In the provisioning app's Authentication settings, turn on Allow public client flows to enable device-code login. This setting enables authentication, not permission to grant site access. Without it, Microsoft may report that the request body must contain
client_assertionorclient_secret. -
Connect to the target site with the provisioning app. Replace the placeholders with that app's client ID, your tenant ID, and the site collection URL:
Connect-PnPOnline -Url $SITE_COLLECTION_URL -DeviceLogin -ClientId <provisioningClientId> -Tenant <tenantId>Alternatively, use interactive authentication:
Connect-PnPOnline -Url $SITE_COLLECTION_URL -Interactive -ClientId <provisioningClientId>If interactive authentication fails, see Troubleshoot the interactive connection.
-
Grant the crawler app access to the site collection. Set
$CLIENT_IDto the SharePoint app client ID entered in Glean, not the provisioning app's ID unless they are the same app. Set the required-DisplayNameto a descriptive label for that app's site permission:Grant-PnpAzureADAppSitePermission -AppId $CLIENT_ID -DisplayName "Glean SharePoint" -Site $SITE_COLLECTION_URL -Permissions FullControlThis command is an alias of
Grant-PnPEntraIDAppSitePermission. See the PnP command reference. -
Repeat the grant for every site collection you want to index and for each additional SharePoint crawler app. If you temporarily added delegated provisioning permissions or turned on public client flows, restore those settings after provisioning. Keep the application permissions and per-site grants needed for crawling.
-
If the credentials step already shows Site URLs, enter every site and subsite URL to crawl as a comma-separated list. Click Save in the previous Setup form or Continue in Set up indexing. Resolve any reported errors, but do not start the crawl yet. If no site URLs are configured, continue to the inclusion rules before starting the crawl. A successful save without URLs does not confirm access to your sites.
Provide the list of all sites to be crawled
Glean cannot automatically discover every site with Sites.Selected grants. Enter the URL of every site or subsite to crawl. If you want a site collection and all its subsites indexed, list every URL explicitly.
If you entered site URLs in the credentials step, save them with validation enabled and resolve any errors. In the previous setup, also complete any Manage data step shown: confirm the URLs and click Save before proceeding. Then continue at step 3. Otherwise, add them through the inclusion rules:
- Open the inclusion rules for your setup:
- In the previous setup, open the Manage data step, which may be labeled optional, then expand Inclusion rules.
- In the new setup, open Review setup → Data access (optional) → Inclusion rules. Do not click Begin indexing yet.
- Enter the URLs in Site URLs as a comma-separated list. If the field prompts you to press Enter, do so to add the URLs to the list. Click Save with validation enabled and resolve any errors before proceeding. During setup, validation may check a subset of sites, so success does not confirm access to every URL.
- After saving the URLs and resolving validation errors, start indexing:
- In the previous setup, open Sync or Schedule first crawl, choose to start the crawl, and click Save.
- In the new setup, return to Review setup and click Begin indexing. This starts indexing. It does not rerun site-permission validation.
If you cannot find a site-URL field or inclusion rules, stop and contact your Glean Deployment Engineer before starting the crawl. Inclusion rules are required for Sites.Selected, even when the interface labels data access optional.
A per-site grant does not replace an inclusion rule, and an inclusion rule does not grant API access. When adding a site, update both the app's site grants and Glean's inclusion rules, then save with validation enabled.
Troubleshoot the interactive connection
If interactive PnP authentication fails, configure the provisioning app's redirect URI:
-
In the Azure portal, open the provisioning app and select Manage → Authentication.
-
Under Platform configurations, click Add a platform.
-
Select Mobile and desktop applications.

Select Mobile and desktop applications on the provisioning app for interactive PnP authentication.
-
Leave the predefined redirect URI checkboxes unchecked and enter
http://localhostin Custom redirect URIs. Usehttp, nothttps. -
Click Configure.
-
Retry the interactive command:
Connect-PnPOnline -Url $SITE_COLLECTION_URL -Interactive -ClientId <provisioningClientId>