1

To do the authentication to SharePoint we can do either

  1. Granting access using SharePoint App-Only
  2. Granting access via Azure AD App-Only

I don't have any issues using the 1st method however some articles suggesting that 2nd approach is the preferred approach.

My question is with 1st approach , I can generate ClientID/secret for each site collection under one tenant. Example for HR , I can use the generated Client ID that can be use only for HR site and for IT I will be having different client id so sharing the Client ID with the developer working specifically for HR wont be able to use the same client id for IT site.

but in 2nd approach , my understanding is we can use the same credentials for any site collection in that tenant.

Please share your thoughts.

5
  • Do you want to use single Azure AD App for all site collection or only selected/single site collections? Commented Jun 1, 2022 at 7:45
  • Suppose I have 5 site collections, using 1st approach I can generate clientID/ secret for each site collection and can assign to developers. Developer A having client iD/secret for site A won’t be able to access site B. But in 2nd approach, can I achieve that ?
    – Saira
    Commented Jun 1, 2022 at 10:12
  • 1
    Yes, you can by using Sites.Selected permissions: devblogs.microsoft.com/microsoft365dev/… Commented Jun 1, 2022 at 11:24
  • 1
    Thank you so much Ganesh.
    – Saira
    Commented Jun 1, 2022 at 22:06
  • You're welcome. Glad it helped you! Commented Jun 2, 2022 at 7:27

1 Answer 1

2

Yes, your understandings are correct. However, for second approach (Azure AD App), you can restrict the access to specific site collections for Azure AD App.

You can use Sites.Selected permissions scope to restrict access to selected site collections.

Check more details at: Controlling app access on a specific SharePoint site collections is now available in Microsoft Graph

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.