Client secret authentication uses traditional Azure App Registration credentials to connect to SharePoint. This method is suitable for most basic SharePoint integrations.Note: Permission sync is not available with client secret authentication. Use certificate-based authentication if you need permission sync functionality.
Navigate to the “API Permissions” tab in the Azure Portal.
Click Add a permission.
Click Microsoft Graph, then click on Application permissions.
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.
Click Add permissions.
Finally, click Grant admin consent for <Organization name> (located next to Add a permission) and click Confirm.