Create an add-in for Excel for a listening server

Enrico Rossini 176 Reputation points

From an Excel file, I want to call a bunch of APIs protected with Microsoft Entra ID. The multifactor authentication is enabled as explained in this Microsoft document. So, my idea is from an Excel spreadsheet to call the Entra ID and access the data. Here is an easy schema.

enter image description here

Now, the Excel spreadsheet needs the authentication token to be added to the HTTP request as explained in this Microsoft document. Because the MFA is enabled, if I call the Entra ID for the login, I get an error because I have to be authenticated with MFA. Generally, when I test my APIs, for example from Swagger, I click on the Authentication button on the page, I am redirected to the Microsoft pages for the authentication, and, after the successful authentication, Microsoft callbacks to the Swagger page where I have the token.

I can't find a way from an Excel spreadsheet to do that. Also, I googled it, and I can't find a way to create a server that is listening on a specific port to receive the callback from the Microsoft pages.

Is there any solution for it?

One idea was to create an Excel add-in and implement a listening server on a specific port to receive the callback. I don't know what the limitations are and if it is possible to do something like that.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,455 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,638 questions
0 comments No comments
{count} votes