An Office service that supports add-ins to interact with objects in Office client applications.
Thank you for reaching out to Microsoft Q&A forum
Based on your requirement, I have conducted some research and found the best approach in this situation is using nested app authentication method, it allows your client-side JavaScript to leverage the authentication session of the native Outlook host to securely and silently request Microsoft Graph tokens directly. Because it uses modern OAuth 2.0 bound to the user's active Office session, it inherently satisfies Conditional Access policies (including Continuous Access Evaluation) that legacy EWS tokens fail against.
- Configure Entra ID (Azure AD): Update your existing App Registration by adding a Single-page application (SPA) platform. Set the redirect URI to
brk-multihub://<your-add-in-domain> - Grant Graph Permissions: Request the necessary Microsoft Graph API permissions in the Entra ID portal and grant admin consent.
- Install MSAL: Add the
@azure/msal-browserpackage to your frontend project. - Initialize the Nestable Client: In your add-in's initialization logic, initialize MSAL using the
createNestablePublicClientApplicationmethod rather than a standard client. - Acquire Graph Tokens Client-Side: Use MSAL's
acquireTokenSilent(with a fallback toacquireTokenPopupfor MFA/consent prompts) to request a token scoped to Microsoft Graph. This natively satisfies Conditional Access through the Outlook host. - Replace EWS with REST: Remove all instances of
makeEwsRequestAsyncand SOAP envelopes. Use the access token you just acquired to make standard REST calls (or use the@microsoft/microsoft-graph-clientSDK) to the applicable endpoints.
Hope my answer will help you
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.