NAA: Unable to initialize MSAL on Outlook for Windows in an Event handler
Closed this issue ยท 10 comments
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
- Create an Outlook app with an LaunchEvent handler registered with the OnNewMessageCompose event.
- 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
- Wrap the code in try/catch and log any errors
- Run Outlook and create a new email
- 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.
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
Assigning to mattgeim for documentation once this is enabled.
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 do we have a timeline yet? Thanks!
@fedeisas - event based add-ins should be testable in preview in the Beta channel now.
How can we be getting this close to a deprecation of Exchange Web Service token usage and all of this is not yet available in GA for us to be developing and testing against on all platforms?
@mattgeim I would just like to confirm that NAA-SSO is now usable in Event-based addins? How about NAA-SSO on spam addins? Thanks.
Thanks @manuelsidler . Tracking that ticket as well. Thanks again.