Building and customizing solutions using Microsoft 365 Copilot APIs and tools
Hello Dibakar Pradhan,
You’re right—SPFx webApiPermissions (delegated) become hard to justify in enterprise setups due to tenant-wide consent. In such cases, Client Credentials flow (app-only) using an Azure AD App Registration (Client ID + Secret) is the recommended approach.
Use Client Credentials flow (app-only auth) with an Azure AD App Registration to avoid tenant-wide delegated permissions in SPFx. Instead of webApiPermissions, create an app with Client ID + Secret, grant application permissions, and use MSAL to acquire a token (.default scope). This token can then securely call APIs (e.g., Microsoft Graph) from a backend service, making it ideal for enterprise scenarios where centralized control and least-privilege access are required.
Your feedback is important to us. Please rate us: 🤩 Excellent 🙂 Good 😐 Average 🙁 Needs Improvement 😠 Poor