Closed manuelsidler closed 1 month ago
Hi @manuelsidler, thanks for reporting the issue. Can you please share the add-in in a private repo and give access to @exextoc. This way we will be able to investigate faster.
@dahuja10 @exextoc I created a public GitHub repository to reproduce the issue: https://github.com/manuelsidler/outlook-naa-sample
There's also an issue when using NAA for event-based activation on the web and Mac:
Uncaught SyntaxError: Identifier 'Logger' has already been declared (at launchEvent.js:1:1)
It seems like a variable scope conflict between Officejs and azure/msal-browser.
Hi @manuelsidler I want to mention there is a new NAA sample in PR that shows how to implement NAA in events. In particular you have to be careful how to configure webpack to avoid pulling in hot reload code when importing MSAL JS. https://github.com/OfficeDev/Office-Add-in-samples/pull/832
Hoping this helps with the issues you are seeing!
@davidchesnut I updated my sample repository (see comment above) based on your PR. Now I get the following error:
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] { status: 'PERSISTENT_ERROR' }
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Info - Could not initialize Nested App Auth bridge ([object Object])
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Info - Nested App Auth Bridge available: false
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Verbose - BrowserCrypto: modern crypto interface available
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Verbose - BrowserConfigurationAuthError: storage_not_supported: Given storage configuration option was not supported.
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Info - Emitting event: msal:initializeStart
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Verbose - Claims-based caching is disabled. Clearing the previous cache with claims
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Verbose - BrowserCacheManager.getTokenKeys - No token keys found
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] [Tue, 27 Aug 2024 13:48:10 GMT] : [] : @azure/msal-browser@3.21.0 : Info - Emitting event: msal:initializeEnd
27/08/2024 15:48:10 Verbose Runtime [Console] [Log] Unable to get Graph access token: TypeError: Cannot read properties of undefined (reading 'hash')
Object.h [as error] foundation.win32.bundle:57:1965C:\Users\manuel\AppData\Local\Microsoft\Office\16.0\Wef\{F3CA16E1-316B-44E6-B878-1D17DB9631EF}\a_tR7qffwhEaRODfyEFigA==\Javascript\21f402cd-0052-4c5f-b9ca-700b80899e89_1.0.0.0_en-US\bundle.js:11256:14 Generator.throw :0:0 rejected C:\Users\manuel\AppData\Local\Microsoft\Office\16.0\Wef\{F3CA16E1-316B-44E6-B878-1D17DB9631EF}\a_tR7qffwhEaRODfyEFigA==\Javascript\21f402cd-0052-4c5f-b9ca-700b80899e89_1.0.0.0_en-US\bundle.js:31:26
@davidchesnut acquiring an access token via NAA in send event now works with beta channel version 16.0.18028.20004
Glad it's all working! The sample is now published at https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/auth/Outlook-Event-SSO-NAA. Closing this issue for now but let us know if you need help with anything else. Thanks!
Your Environment
Expected behavior
Acquiring an access token for event-based activation (onMessageSend) via NAA works the same as inside the taskpane.
Current behavior
Acquiring an access token results in ServerError
Code snippet of the message send handler:
Steps to reproduce
Useful logs