Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAA: Unable to initialize MSAL on Outlook for Windows in an Event handler #4450

Open
htryggva opened this issue May 14, 2024 · 3 comments
Open
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback

Comments

@htryggva
Copy link

An exception is thrown when initializing the MSAL library:

[BrowserAuthError: crypto_nonexistent: The crypto object or function is not available.]
  errorCode: 'crypto_nonexistent',
  errorMessage: 'The crypto object or function is not available.',
  subError: '',
  name: 'BrowserAuthError'

Your Environment

  • Platform: PC desktop
  • Host: Outlook
  • Office version number: Beta Channel Version 2406 Build 17630
  • Operating System: Windows

Expected behavior

The initialization and authenticating using NAA should be successful when running in an Event-based Activation scenario.

Current behavior

An exception occurs.

Steps to reproduce

  1. Create an Outlook app with an LaunchEvent handler registered with the OnNewMessageCompose event.
  2. Initialize NAA according to the documentation: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/enable-nested-app-authentication-in-your-add-in#initialize-the-public-client-application
  3. Wrap the code in try/catch and log any errors
  4. Run Outlook and create a new email
  5. Use Runtime Logging to observe the exception:
[BrowserAuthError: crypto_nonexistent: The crypto object or function is not available.]
  errorCode: 'crypto_nonexistent',
  errorMessage: 'The crypto object or function is not available.',
  subError: '',
  name: 'BrowserAuthError'

Context

We want to move our add-in over to the new auth model.

Useful logs

window.nestedAppAuthBridge is undefined in this context. It is defined when running our add-in in the Taskpane.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label May 14, 2024
@exextoc exextoc added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Outlook Issue related to Outlook add-ins and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels May 14, 2024
@exextoc exextoc self-assigned this May 14, 2024
@timwan10
Copy link

Support for NAA in Event Based Add-ins is not enabled yet. This feature is coming, but there is not a timeline to share right now.

Internal Ref #: 8774618

@timwan10
Copy link

Assigning to mattgeim for documentation once this is enabled.

@manuelsidler
Copy link

@timwan10 @mattgeim Will it be available when legacy Exchange callback tokens will be turned off in October 2024? Our event-based add-in is using the Outlook REST API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback
Projects
None yet
Development

No branches or pull requests

5 participants