Description
URL of sample
Describe the bug
My primary Windows login is a Microsoft Personal Account. I also have a Work account linked to it and I can switch between them in the browser and in Excel.
When I start Excel, by default, it uses my Personal Account. When my add-in calls Office.auth.getAccessToken(), I get the JWT for that account.
When my add-in falls back to getAccessMSAL(), I get the JWT for my work account, which is not the account I'm using in Excel.
To Reproduce
Steps to reproduce the behavior:
- Create a new Microsoft personal account and log in to Windows with it
- In Windows settings, add a work account
- Start Excel, note the name in the Window title bar is the personal account
- Open the addin, set useSSO = true, run it and check the JWT - notice it's the personal account
- set useSSO = false, run it and check the JWT - notice it's the work account
Note that the above might depend on which account(s) are logged in on the browser.
Expected behavior
Both Office.auth.getAccessToken and getAcessTokenMSAL should return the same account, and that should be the one logged in to Excel
Environment
- Platform [PC desktop, Mac, iOS, Office Online]: PC desktop
- Host [Excel, Word, PowerPoint, etc.]: Excel
- Office version number: version 2405
- Operating System: Windows 11
- Browser (if using Office Online): ______
Additional context
Add any other context about the problem here.
Activity