baouss
baouss

Reputation: 1880

Inject (own) Azure Ad id_token in Office Scripts external fetch request

Looking to make an Azure-AD authenticated external API call from within an Office-Scripts-enabled Excel Online workbook. Access to the workbook is secured to members of my organization only, so interaction with the workbook is possible only via an (Azure-AD) authenticated session.

Do you have any idea on the user's own id_token could be injected in the request? This way, the receiving end would be able to validate that the request originated from an authenticated user, by validating the token's signature.

Kind regards

Upvotes: 0

Views: 261

Answers (1)

Gergely
Gergely

Reputation: 106

There is no supported way to inject the user token into an Office Script right now. For authenticated calls, the recommended approach is to create a Power Automate Flow that uses the appropriate credentials to fetch whatever data the Office Script needs, then pass it to the script via its optional params in main, perform processing, and either write to the document or return the value from the script so the subsequent Flow steps can consume it. Does that work for your scenario?

Upvotes: 0

Related Questions