I'm trying to make an _Outlook for web_ add-in with Yeoman, configuring it initially for SSO.
From a TaskPanel OfficeRuntime.auth.getAccessToken({ allowSignInPrompt: true }) works just fine.
From an event-based action, OnNewMessageCompose, I get an error code 5001 (Internal error).
This is my first add-in, I can't confirm this is a bug but at least I'm calling for help. 馃檹
I expect OfficeRuntime.auth.getAccessToken({ allowSignInPrompt: true }) to return a token.
This appears in Chrome's browser:
Uncaught (in promise)
OSF.DDA.Error {
name: "Une erreur interne s'est produite",
message: "Une erreur interne s'est produite",
code: 5001
}
OnNewMessageCompose to change to default signature of the email : this should work.const token = await OfficeRuntime.auth.getAccessToken().I am trying to get user information, as I succeeded via a TaskPanel, to then call a HTTPS server of mine and get signatures for current user.
Thanks for your help. 馃檹
Your observation is correct. Some APIs are not supported in event-based activation. These limitations are mentioned here:
https://docs.microsoft.com/en-us/office/dev/add-ins/outlook/autolaunch#event-based-activation-behavior-and-limitations
Exactly @exextoc , and thank you for your help!
What bugs me is that this doc only refers to getAccessTokenAsync not being supported and not getAccessToken.
I admit I've doubted getAccessToken wouldn't be supported neighter though I'd like a confirmation.
Makes sense. We will update documentation to add 'getAccessToken' API as well explicitly. Thanks for the feedback.
Updated documentation should be published soon.