What is the proper approach to handling MSAL authentication in an Outlook Add-in on Android?

Nazar Serdiuk 0 Reputation points
2025-03-06T20:02:38.0833333+00:00

Hello,

I am developing an Outlook Add-in that requires MSAL authentication. The Add-in is a React app created with the Yeoman generator, and I am using the msal-react library for authentication.

To authenticate users, I use the loginPopup method of an MSAL instance. This approach works as expected on the web, iOS (where it redirects within the Outlook internal browser), and desktop applications.

However, I am encountering an issue on the Android version of the Outlook app. Instead of opening an in-app browser (as it does on iOS), loginPopup redirects users to an external browser for authentication. After logging in, users are not redirected back to the Outlook app. Instead, they are taken to the redirectUri specified in my MSAL configuration, which points to a webpage where my Add-in's source files are hosted.

My question is:

Do I need to specify a different redirectUri to ensure the user is redirected back to the Outlook app and properly authenticated within the Add-in?

Is there a recommended approach that ensures consistent behavior across all platforms (web, iOS, desktop, and Android)?

I would appreciate any guidance or best practices for handling this scenario.

Thank you!

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.
4,304 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.