Is there any way to get one client_id and client_secret for all the sites of the companies SharePoint?

Anirudh Kompella 1 Reputation point
2022-11-09T19:50:00.443+00:00

I am trying to get the excel content from the SharePoint site using client_id and client_secret. But I want to read the excel content from more than 100 sites under companies' SharePoint. Do I need to create them for all the sites separately or Is there any way to get the universal client_id and client_secret for all the sites of our company? #python #sharepoint #office365.SharePoint

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,486 Reputation points Microsoft External Staff
    2022-11-10T02:12:34.023+00:00

    Hi @Anirudh Kompella
    I will recommend you to use Azure AD app only. You can grant the app only with Sites.FullControl.All which will have full control of all site collections. Please refer to the following document
    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread

    You can also register app only in SharePoint by refer to the document.
    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs
    For access all sites in SharePoint. You will need to register a Tenancy scope app. You need to call the appregnew.aspx page in https://contoso.sharepoint.com/_layouts/15/appregnew.aspx. And grant permission in https://contoso-admin.sharepoint.com/_layouts/15/appinv.aspx.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.